Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Currently, the CSS files are the Sass files generated to CSS and then tweaked.
This "tweaking" is accomplished by doing a long, painful "git diff" on the generated CSS and reverting back bits that are in previous versions of the CSS files. When I was the only maintainer, this was reasonable so that we had feature parity between the CSS and Sass files. Now that we have 3 maintainers, its unreasonable to expect all of us to maintain a cumbersome process like that.
I need to write a shell script that automates the process.
Comments
Comment #1
JohnAlbinOk. I've pushed new code for this. If you are on a Mac or UNIX machine this should work:
cd zen-internals
./generate.sh
The generate.sh script will pull in various pieces of code and text from the zen-internals/extras folder and run
compass watch
(twice) in order to get the STARTERKIT/css files and zen-internals/css files generated.This needs review by both Kris and Ellie! Does this work for you two?
Comment #2
echoz CreditAttribution: echoz commentedWorks fine :-)
All zen's files remain the same after running ./generate.sh
The cli output is:
./generate.sh
remove css/styles-rtl.css
remove css/styles.css
create css/styles-fixed-rtl.css
create css/styles-fixed.css
create css/styles-rtl.css
create css/styles.css
remove .sass-cache/
create css/css-global-states-rtl.css
create css/css-global-states.css
create css/css-layout-fixed-rtl.css
create css/css-layout-fixed.css
create css/css-layout-responsive-rtl.css
create css/css-layout-responsive.css
create css/css-modular-styles-rtl.css
create css/css-modular-styles.css
create css/css-normalize-rtl.css
create css/css-normalize.css
create css/css-print.css
create css/styles-rtl.css
create css/styles.css
Comment #3
JohnAlbinYayz! :-D
Ok, let's have Kris review it now.
BTW, I have no illusions that I will be the sole maintainer of the generate.sh script; it is a bear of a script chock full of ancient sed-based regular expressions. :-p
Comment #4
KrisBulman CreditAttribution: KrisBulman commentedAwesome! I'll review this shortly
Comment #5
KrisBulman CreditAttribution: KrisBulman commentedhmm, having some problems.
cloned a fresh copy:
ran script:
Comment #6
KrisBulman CreditAttribution: KrisBulman commentedComment #7
KrisBulman CreditAttribution: KrisBulman commentedLooks like this is a problem with OS X's BSD Sed which behaves a little differently, so I installed gnu-sed via homebrew with
Which got rid of the "parentheses not balanced" messages, however I now get this :\
There seems to be a problem with these two files and the script (in my case):
What do these files have in common you ask? apostrophes. By removing the apostrophes from both normalize.scss and these two search.txt files, the script runs like a charm.
Now.. to track down the apostrophe problem in the regex..
Comment #8
echoz CreditAttribution: echoz commentedOS X 10.8.2 here.
Comment #9
KrisBulman CreditAttribution: KrisBulman commentedTried everything I can here, still fails on apostrophes (only) :(
Comment #10
echoz CreditAttribution: echoz commentedThe other difference on my system (same compass 0.12.2 + sass 3.2.3) is ruby 1.8.7
Comment #11
KrisBulman CreditAttribution: KrisBulman commentedI use rvm to switch between ruby versions, I swapped back to the system ruby just to be sure (although it doesn't seem like a likely culprit) and it still chokes on apostrophes. Hoping John has some insight.. perhaps the perl regex just needs to be tweaked?
Comment #12
KrisBulman CreditAttribution: KrisBulman commented@echoz can you try replacing this line
with this one:
And tell me if you get the same output as before?
Comment #13
echoz CreditAttribution: echoz commentednow i get the error - my result:
./generate.sh
remove .sass-cache/
remove css/styles-rtl.css
remove css/styles.css
create css/styles-fixed-rtl.css
create css/styles-fixed.css
create css/styles-rtl.css
create css/styles.css
remove .sass-cache/
create css/css-global-states-rtl.css
create css/css-global-states.css
create css/css-layout-fixed-rtl.css
create css/css-layout-fixed.css
create css/css-layout-responsive-rtl.css
create css/css-layout-responsive.css
create css/css-modular-styles-rtl.css
create css/css-modular-styles.css
create css/css-normalize-rtl.css
create css/css-normalize.css
create css/css-print.css
create css/styles-rtl.css
create css/styles.css
FATAL ERROR: The following file contents were not found: normalize--font-face--search.txt
Comment #14
KrisBulman CreditAttribution: KrisBulman commentedInteresting, that's what fixes mine! :\
Comment #15
echoz CreditAttribution: echoz commentedConsidering 10.8 ? An improvement over Lion.
Comment #16
KrisBulman CreditAttribution: KrisBulman commentedwell, actually it doesn't really fix it.. it adds a bunch of whitespace at the end of each line.
I have another mac at work I will try the original script on (both have xcode 4.2 installed).
Comment #17
KrisBulman CreditAttribution: KrisBulman commentedyeah, will have to time-machine this one but i will update it if it gets me going.
Comment #18
JohnAlbinI am on OS x 10.8 as well. The script uses the standard 10.8-installed versions of perl and sed. It really sucks that there's a difference with 10.7. ugh. Trying to get the sed regexs to work properly in the first place was a total pain.
Kris, the script implements a draconian measures if a text replacement fails to occur; it deletes all the generated CSS. I've updated the script so that it at least leaves the file that generated the error, so you can more easily figure out which perl/sed bits are failing.
so there are 3 places the script could be failing:
somewhre before: # Replace "TEXT-REPLACEMENT" token with contents of replacement file.
Trying adding
echo $FIND
at line 102. Then we can determine which of the 2 places are failing.Comment #19
KrisBulman CreditAttribution: KrisBulman commentedHere is the output after adding the echo $FIND
Comment #20
JohnAlbinOkay. So the perl script is properly returning
\n\ \ \ Since\ we\'re\ using\ Sass\,\ you\'ll\ need\ to\ declare\ your\ font\ faces\ here\,\ then\ you\n\ \ \ can\ add\ them\ to\ the\ font\ variables\ in\ the\ _base\.scss\ partial\.\n
for the $FIND variable in line 101. That means line 105 is failing.Interestingly, that's the only sed command that uses double quotes for its commands (since it needs to let the shell expand $FIND.)
Okay, I've pushed a change which limits the double quotes to a just a single sed command, instead of the entire series of sed commands on that line. Try it again, Kris?
Comment #21
KrisBulman CreditAttribution: KrisBulman commentedStill a no go, but I figured 20 bucks is a small price to pay to resolve this ticket.. after the OS X 10.8 upgrade everything works as it should and a diff after running generate.sh returns an empty patch, so we're good!
Comment #22
echoz CreditAttribution: echoz commentedSomething new to report.
I believe it was after I updated to Sass 3.2.5 that I noticed my compile from ./generate.sh differs from yours in that it compiles to 6 digit hex color numbers rather than the shorthand 3 digit. Now yours has come back with the shorthand (which I prefer, btw) and on my end, testing still results in 6 digits. It also does 0.5em to your .5em for one instance of padding.
Comment #23
JohnAlbinI just upgraded to Sass 3.2.6. And I've got the long-form hex colors and 0.5em instead of .5em.
Comment #25
echoz CreditAttribution: echoz commented... and Sass 3.2.7 brings us back to shorthand 3 digit hex, etc. A bleep in Sass development :-)