question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Questions: How to make sass prefix?

See original GitHub issue

I apply the following prefix setting for ‘sass’. But the output is not what I want. The ‘/’ signs remain. And the text color is not red. Do I need to add another setting? I added the prefix setting as in the document, but I seem to be missing something.

it’s not working.

prefix: "#single-spa-application:\\@kapital\\/dashboard"

output still has ‘/’ signs.

#single-spa-application:\@kapital\/dashboard .deneme {
    color: red;
}
image image image image image

prefix i need

#single-spa-application:@kapital/dashboard .deneme {
    color: red;
}

but when I use it like this, SassError: SassError: Expected identifier. I get an error

image

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
RadValentincommented, Apr 24, 2022

@ahmetcaglayan I was confused by the various escaped characters but I think it should work. You had it right initially, you just needed to escape the : character. Please try the following:

  • set prefix: "#single-spa-application\\:\\@kapital\\/dashboard"
  • in SASS and CSS the selector will be prefixed with #single-spa-application\:\@kapital\/dashboard
  • The CSS selector above will match elements that have id="single-spa-application:@kapital/dashboard

Example here: https://codepen.io/valentin/pen/KKZLWej

1reaction
RadValentincommented, Apr 23, 2022

@ahmetcaglayan I understand now, in the docs they set the prefix to:

"#single-spa-application\\:\\@org-name\\/project-name"

and then in the CSS output it will become

#single-spa-application\:\@org-name\/project-name

And because the characters are escaped, \:, \@, etc., it will work in plain CSS (https://jsbin.com/fequwemije/edit?html,css,output). The problem is that the SASS compiler doesn’t like this kind of escaping.

Screenshot 2022-04-23 at 17 32 11

I don’t think I can help you. It looks like SASS doesn’t like those escaped characters. I’d suggest using supported characters.

Read more comments on GitHub >

github_iconTop Results From Across the Web

sass - How to make File Watcher add vendor prefixes in SCSS?
What do I do so that the File Watchers compile my SCSS code and automatically add the vendor prefixes? sass · webstorm ·...
Read more >
Use Autoprefixer for browser compliant code - OpenClassrooms
It does exactly what it sounds like: automatically add prefixes to your CSS. All you do is supply it with a CSS sheet,...
Read more >
Top 40 SASS Interview Questions and Answers (2022)
Here are SASS and SCSS interview questions and answers for freshers as well as experienced ... Simple prefix with ~ symbol and put...
Read more >
Autoprefixer: A Postprocessor for Dealing with Vendor ...
Autoprefixer parses CSS files and adds vendor prefixes to CSS rules using the Can I Use database to determine which prefixes are needed....
Read more >
CSS, SCSS, and Less support in Visual Studio Code
Step 2: Create a simple Sass or Less file. Open VS Code on an empty folder and create a styles.scss or styles.less file....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found