-
Notifications
You must be signed in to change notification settings - Fork 102
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
Add SASS prefix handler #2016
Add SASS prefix handler #2016
Conversation
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.
Could you extract te function to a separate file. Also write some tests for the input/output.
Add a custom matcher pealse to remove the replace for all the strings. |
// slice the selector before that, if it's top level selector, add prefix in a scope above, if its nested, dont care | ||
|
||
const addPrefixToContent = (content: string, sassPrefix: string): string => { | ||
// Stack to store pairs of opening and closing curly brace indexes |
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.
Maybe instead of building a custom parser, we can utilise sass' compileString
function? https://sass-lang.com/documentation/js-api/functions/compilestring/
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.
Hm. I thought maybe compileString would allow to have a more structured representation of the css, but it's just a string too.
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.
Oh, we don't want to compile, we will leave that to saas. We just want to not prefix css rules that match the app name. To allow styling the root element. I think is a manual process. I wish there was some nice AST for scss that is not 10 years old.
:soon::shipit::octocat: |
🌱 🌸 🌷 🌻 🌟 New version of package has been released 🌟 🌻 🌷 🌸 🌱 The release is available on: :package:@redhat-cloud-services/frontend-components-config/v/6.0.15📦 :boom:This feature is brought to you by probot🚀 |
Jira ticket: RHCLOUD-24774