Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix scss order #106

Closed
wants to merge 1 commit into from
Closed

fix scss order #106

wants to merge 1 commit into from

Conversation

tschanzt
Copy link

@tschanzt tschanzt commented Sep 7, 2016

This way references like the linkcolor which is set to the primary color should still be correct.

@bierik
Copy link
Member

bierik commented Sep 7, 2016

@jone I guess there's something wrong with these changes. I remember a discussion we already had about this topic. Could you please explain the issue here.

@jone
Copy link
Member

jone commented Sep 7, 2016

  • resources/scss/config.scss is used for setting values of variables not owned by "my" package, but e.g. by ftw.theming or the theme. New variables shall not be declared here!
  • resources/scss/variables.scss is used for inventing / declaring new variables. Foreign variables (ftw.theming, theme) can be overriden here, but this is only an edge case for when we have dependencies on other foreign variables and thus this cannot be solved in config.scss.

Therefore the correct order is:

  1. resources/scss/config.scss
  2. ftw.theming:resources/scss/globals/variables.scss
  3. plonetheme.blueberry:scss/globals/variables.scss
  4. resources/scss/variables.scss

Currently, 3. and 4. may be inverted because the dependency is not declared correctly.
In order to fix that, we should apply this change in the bob template:

-        <theme:scss file="resources/scss/variables.scss" slot="variables" after="ftw.theming:resources/scss/globals/variables.scss"/>
+        <theme:scss file="resources/scss/variables.scss" slot="variables" after="plonetheme.blueberry:scss/globals/variables.scss"/>

We can do this since the "web" template includes plonetheme.blueberry.


Example:

// resources/scss/config.scss
$color-primary: purple;  // 👍 pre-configure variable
$my-background-leadtext: yellow !default; // 🚫 new variables must be declared in resources/scss/variables.scss
$color-link-visited: $color-secondary; // 🚫 does not work, should be moved to resources/scss/variables.scss
// ftw.theming:resources/scss/globals/variables.scss
$color-primary: fuchsia !default;
$color-secondary: green !default;
$color-link: black !default;
// resources/scss/variables.scss
$my-color-leadtext: $color-primary !default; // 👍 new variables should be declared here
$color-primary: purple; // 🚫 existing variables should be overridden in config.scss
$color-link: $color-secondary; // 👍 Exception to the rule: line must be here, because in config.scss we have not yet $color-secondary declared.

Conclusion

This PR should not be merged, but the above change (diff) should be applied. @tschanzt can you make a PR with the change above? Thanks

@jone jone closed this Sep 7, 2016
@raphael-s raphael-s deleted the tt-fixorder branch July 20, 2017 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants