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.

Classnames separated by dots are removed

See original GitHub issue

If I have a selector in my css .my-class.something-else, it is getting removed even though my I have this in my settings whitelistPatterns: [/^my-/]. There are many variants of that like .my-class.another-thing, so how can I be sure to keep them all? Shouldn’t my whitelist pattern already work for this?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:5

github_iconTop GitHub Comments

2reactions
mdominguezcommented, Dec 31, 2018

I needed to whitelist classes similar to for example .mb-1.5 that we’re getting purged… Tried the /^.[^\.]*\.[^\. "']*/g regex and it worked 😃 thanks!

0reactions
erikwestlundcommented, Nov 11, 2018

This is also a problem for me.

I have this:

        /^component-*/,
        /\.component-tagBox\.tag\.valid/

in the extractor whitelist

and this in my css (tailwind):

.component-tagBox.tag.valid { @apply bg-blue; }

and it doesn’t work.

It does work with a single class name in the CSS, e.g.,:

.component-tagBox { @apply bg-blue; }

But i need the compound class for it to do what I want to do using a third party vue comonent.

Any tips?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can you use a dot in a class name? Cos the buttons aren't ...
Short answer: no. You'll want to remove those dots or replace them with something else. Longer answer... A dot within a CSS selector...
Read more >
Is it possible to use the space character in CSS class names?
There is no way to escape the space character in the class attribute value and hence will always be interpreted as two different...
Read more >
Reducing CSS bundle size 70% by cutting the class names ...
There is a good reason I have added _ into the CSS class name separating the component name and the local identifier name...
Read more >
Its giving an error that says remove active dot from current dot ...
What i tried to communicate, is that the removeClass(), addClass() and toggleClass() methods are expecting a “string representing the =class-name=” which will ...
Read more >
Convert the Java-class-name (dot delimited package name)to ...
Convert the Java-class-name (dot delimited package name)to the equivalent ... with '/' and append ".class" ( possibly // after already removing it -...
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