-
Notifications
You must be signed in to change notification settings - Fork 42
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
HDS-2367: Better SCSS tool to replace BEM util #1457
base: development
Are you sure you want to change the base?
Conversation
Version matches React's jest, so no lock file changes.
Sass is missing a lot of basic stuff, so added functions for them
The mixin file has container embedded to the base. Cannot separate and import to React module
Test Results 1 files 66 suites 12m 27s ⏱️ Results for commit 2fb2804. ♻️ This comment has been updated with latest results. |
Preview found from hds-demo docs/preview_1457 Demos |
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 is huge PR, and excellent! Good work. packages/core/src/utils/README.md is really good documentation page how our scss system works!
Description
Constructing scss files with the style that was introduced in the cookie-consent is very verbose and requires a tedious amount of
@if $all or $xyz or $other
blocks.The "_bem.scss" helps to create selectors for all combinations of block + modifier + element, but is not very usable with the
@if...
syntax.This tool makes creating scss and outputting css simpler.
Instead of (examples from button.scss)
You can use
This new tool, named "multi-sass", stores the arguments passed to it, so there is no need for
@if
blocks. If outputs the selectors with correct prefixes and delimeters, so the old "_bem.scss" will be obsolete.Didn't have time to do more conversions other than button-mixin. But added testing tool to verify the outputted css matches, which makes converting easier.
The tool also helps with using core with React, because it can output css directly to wrappers used in *.module.css and strip selectors used in core *.scss.
The code and logic is explained in detail in the README.md
Related Issue
Helps with HDS-2367
How Has This Been Tested?
Added scss testing tool.
Demos:
Links to demos are in the comments
Screenshots (if appropriate):
Add to changelog