-
-
Notifications
You must be signed in to change notification settings - Fork 729
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
Moved definition of colors in the cookies modal and banner colors to common darkswarm/base/colors #2735
Merged
sauloperez
merged 3 commits into
openfoodfoundation:master
from
luisramos0:cookies_colors
Dec 5, 2018
Merged
Moved definition of colors in the cookies modal and banner colors to common darkswarm/base/colors #2735
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,13 @@ | ||
@import 'darkswarm/branding'; | ||
|
||
$modal-background-color: #efefef; | ||
$modal-content-background-color: #fff; | ||
$modal-alert-link-color: #fff; | ||
$modal-alert-link-hover-color: rgba(255, 255, 255, .7); | ||
|
||
$cookies-banner-background-color: $dark-grey; | ||
$cookies-banner-button-background-color: $clr-turquoise; | ||
$cookies-banner-text-color: $white; | ||
$cookies-policy-modal-background-color: $disabled-light; | ||
$cookies-policy-modal-border-bottom-color: $disabled-light; | ||
$cookies-policy-modal-table-tr-even-background-color: $disabled-very-light; |
8 changes: 4 additions & 4 deletions
8
engines/web/app/assets/stylesheets/web/pages/cookies_banner.css.scss
This file contains 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
8 changes: 4 additions & 4 deletions
8
engines/web/app/assets/stylesheets/web/pages/cookies_policy_modal.css.scss
This file contains 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm also lost with CSS color vars naming but, does this mean we'll have a var for each of
$dark-grey
uses we'll have? won't we end up with trillions of single-purpose vars?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sauloperez Ideally, we'd keep in mind to extract CSS components when possible. For example, there could be just one set of color assignments in one SCSS partial for general styles used in all modals. So maybe not trillions 😉 but a hundred or so variables.
For the cookies banner though, the color assignments are quite unique, so they would be single-purpose.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you mean having an SCSS file for each new UI component where we assign the palette vars to component vars? looks good 👍 naming colors vars seems like a very difficult problem for me. I'm struggling with my side project 😓
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To clarify, the style I suggested, which is also how @luisramos0 did it in this PR, is to assign the palette vars to component vars in a central file. Each component SCSS partial only uses the component vars.
Good luck with your side project! 😟
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
yes, that central file is this colors.scss file.
if it gets to big, we can move some parts to separate files, as you say, for example, modals_colors.scss
The new convention here is that when you set a color in your component scss, you always set it to a variable like in menu.scss:
li a { color: $menu-mobile-li-a-color; }
instead of
li a { color: rgba(0, 0, 0, 0.9); }
or
li a { color: $dark-grey; }
and then you go to colors.scss to assign this variable $menu-mobile-li-a-color = $dark-grey;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's doc this if the rest of the team agrees.