-
-
Notifications
You must be signed in to change notification settings - Fork 103
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
enhancement(Navbar) implemented classname, hovering link color bug, #588
Conversation
Additionally made color and background color states important to fix specificity issue on same specificity level (eg. classname - classname) |
I very much like the classname based approach. This is much needed. |
sass/components/colors.module.scss
Outdated
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.
Why use !important. Please not. This is no good practice.
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 implemented it because the color states currently introduces a specificity problem with other classnames
They share the same specificity level if it's all based on class name, primary (or other color state) color profiles defined by color classes could get overridden by the component class background color, by declaring important state it makes sure it always has the color state defined
Another idea to avoid component overrides without using the important context would be to introduce the color states in mixins and declare them specifically on each component
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.
This pull-request is currently invalid since defining the colors-module classes on the component is not working
If we look at the _colors-classes.scss it has also !important context declared
While using colors from colors-classes currently works on the navbar, colors from the colors-module are getting overridden by module defined colors because of the missing important context
I don't understand why we can use it in the color classes but not in the colors-module since adding one of colors-module class to an existing component should always result in the component rendering the specified properties of the colors-module class, right?
Possible two solutions for this scenario:
- Implement the !important context so we can just use the classname (preferred)
- Create mixins for all color-modules classes and define them on each component separately
Proposed changes
Fixed todo in navbar by adding navbar class instead of targeting html tag, also fixes part of #573
Fixed #385 hovering link bug
Checklist: