Last active
October 26, 2025 03:27
-
-
Save chriskyfung/17832481fccc32f81c116845eec26acd to your computer and use it in GitHub Desktop.
Backup of css_to_scss.sh from amp-affiliately-jekyll-theme. This shell is a utility to help convert CSS files into the project's standard SCSS format, streamlining style development.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Directory containing the CSS files | |
| CSS_DIR="./_includes/css" | |
| SCSS_DIR="./_sass" | |
| # Find all .css files in the specified directory, excluding .min.css files | |
| find "$CSS_DIR" -name "*.css" ! -name "*.min.css" | while read -r css_file; do | |
| # Define the corresponding .scss file path | |
| scss_file="${css_file/$CSS_DIR/$SCSS_DIR}" | |
| # Convert the .css file to .scss using sass-convert | |
| sass-convert "$css_file" "${scss_file%.css}.scss" | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment