Assuming as equal two classes differentiated by a number at the end
See original GitHub issueI have the following code:
var purify = require('purify-css');
var content = '<div class="hello">sad<//div><div class="hello2">asdasda<//div>';
var css = '.hello { color: green; } .hello3 { display: block; }';
var options = {
output: 'purified.css',
// Will minify CSS code in addition to purify.
minify: true,
// Logs out removed selectors.
rejected: true,
info: true
};
purify(content, css, options);
And then the content of purified.css is: ‘.hello { color: green; } .hello3 { display: block; }’
It is not deleting hello3, but if I change css as follows, then it works:
var css = '.hello { color: green; } .h { display: block; }';
And then the content of purified.css is:
‘.hello { color: green; }’
I guess it is not taking into account the number at the end of the class.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:8
Top Results From Across the Web
Implicit differentiation review (article) - Khan Academy
In implicit differentiation, we differentiate each side of an equation with two variables (usually x x xx and y y yy) by treating...
Read more >Best way to compare two complex objects - Stack Overflow
Should two objects with the same PersonId but different Age values be considered equal or different? The answer above assumes that one is...
Read more >Chapter 5 Flashcards - Quizlet
Explanation: Overloaded methods are two methods in the same class that have the same identifier, but a different number, type or order of...
Read more >Page 7: Differentiate Product - IRIS Center
When teachers differentiate product, they assess the same concept or skill for each student at the end of a unit of study; however,...
Read more >Differentiation Strategies and Examples: Grades K-2 - TN.gov
example, students write two numbers between 1 and 10, circle the number that is ... together (in groups or as a whole class)...
Read more >Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Solving this would be a huge win; I have tons of utility classes ending in numbers or containing non-standard characters like
:
, for example:.md\:mb-5
…used like:
<div class="md:mb-5">...</div>
…which adds a bottom margin of my 5th spacing unit on medium screens and larger.
Currently, after running PurifyCSS, Chrome still reports 97% of my CSS as being unused:
Uncss wouldn’t work for me because it can’t be run against arbitrary template languages like PHP even. It seems it tries to be a bit too smart IMO, by actually running client side JS and parsing the DOM to find classes, etc.
Purgecss is by design very “dumb”, it just iterates over all of your CSS classes and looks for them as simple string matches in any source file you provide, like a template or JS file. It doesn’t actually parse HTML or anything, it literally just runs a regex against the files you provide. In my experience that makes it very very predictable and easy to use because it’s obvious how to author your templates in a “purgeable” way because the mental model is so straightforward. On Tue, Aug 14, 2018 at 5:57 PM Jay Holtslander notifications@github.com wrote: