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.
Problem
When using a subtheme based on the STARTER files with the zurb_foundation theme, the _settings.scss file is there to customize the variables for foundation. The comment in the STARTER.scss file says "This is your _settings.scss file where you can override foundation variables." However, after modifying the variables, they are overriden by the foundation globals set in the bower components _global.scss file.
The settings file isn't helpful if the variables are overriden. I have not found a good work-around other than editing the _global.scss file.
Comment | File | Size | Author |
---|---|---|---|
#14 | zurb-foundation-settings-update-2.patch | 14.96 KB | samuel.mortenson |
#5 | f6CssOutput.JPG | 34 KB | certifiedGeek |
#5 | f6scss.JPG | 43.03 KB | certifiedGeek |
Comments
Comment #2
ishtarex CreditAttribution: ishtarex commentedAre you using gulp or compass watch to generate fresh css in css subfolder of your subtheme?
Comment #3
certifiedGeek CreditAttribution: certifiedGeek as a volunteer commentedGulp
Comment #4
ishtarex CreditAttribution: ishtarex as a volunteer commentedAre you sure that you set your subtheme theme as default?
I added
var Promise = require('es6-promise').Promise;
to my gulpfile.js and it is working.Comment #5
certifiedGeek CreditAttribution: certifiedGeek as a volunteer commentedYes, I am sure. All my custom scss works fine, but my settings variables get overridden by foundation defaults.
here is my gulpfile.js:
in _settings.scss I set $success-color to red. in bower_components/foundation-sites/_global.scss I set it to green.
In f6.scss I output the variable $success-color in the comments to see where it is being overridden:
Then, after looking at the compiled CSS, you can see in the comments that it is red, then changes to green right after it includes foundation:
Comment #6
quocnht CreditAttribution: quocnht commentedWhat foundation sites version you are using? From 6.2 the colors settings move into the palette.
Put this in the STARTER\scss\_settings.scss and override.
Comment #7
certifiedGeek CreditAttribution: certifiedGeek as a volunteer commentedThat doesn't make a difference. Even with this change, the palette settings still map to the individual color variables later on in the foundation global settings:
I did try it though, without any luck.
Comment #8
quocnht CreditAttribution: quocnht commentedFor your example, I try this in STARTER\scss\_settings.scss
After
@import 'settings';
it load$success-color: red;
in the STARTER\scss\_settings.scss and result.success-color = red
After
@import 'foundation';
, it load the palette and result also.success-color = red
Comment #9
certifiedGeek CreditAttribution: certifiedGeek as a volunteer commentedThanks quocht, putting both the pallete array AND the color variables did override them correctly.
This makes me wonder how many other things have changed that need added or updated in the theme or sub-theme.
Comment #10
ChrisSnyderIs this no longer a Drupal theme related issue and only an issue with Foundation 6 changes?
Comment #11
ChrisSnyderAfter further investigation, I found that in my case the "Disable Base Theme CSS" setting was not set in the theme settings.
Comment #12
jimafisk CreditAttribution: jimafisk commented#8 worked for me, thanks quocnht!
Comment #13
samuel.mortensonI copy+pasted the _settings.scss file from Foundation to the STARTER theme. Anyone want to review and see if it addresses the problems reported here?
Comment #14
samuel.mortensonI updated Foundation to 6.3.0, lots of settings changes.
Comment #15
mariagwyn CreditAttribution: mariagwyn as a volunteer commentedI tested the patch against today's dev release. It correctly overrode the _settings.scss file with the new foundation variables. While this might be overkill since ideally, one just overrides the settings that should be different than default, it works as expected.
Comment #17
samuel.mortensonCommitted after multiple users agreed with changes in another issue.