Comments (1)
I wonder how we can solve this. Should we re-analyze all mappings when we register a new attribute selector, and remap all matching selectors differently so they match the attribute selector rule ?
In that case, we'll loose a slot in the renaming (since the current name generator does not keep track of usage), but at least it would not break the site.
This would also probably disrupt any renaming_map.json
since if you ever parse a new stylesheet and it's containing an attribute selector, the mapping will have to evolve. We can trigger a warning now when this happens.
Or, should we run a first pass on any attribute selector on all input stylesheet (that would be a job for rename-css-selector
to do that) and then we would be safe to run the stylesheets again.
This would also probably disrupt any renaming_map.json
since if you ever parse a new stylesheet after a first run and it's containing an attribute selector, the mapping will have to evolve.
My last idea would be to modify the rule where the attribute selector is found to include the already mapped selector, so instead of:
[class^="i-"]:before {
font: myfont;
}
we would get
[class^="i-"]:before, .a:before {
font: myfont;
}
Please notice that can be very cumbersome too maintain too and will enlarge the CSS file instead of reducing it.
What do you prefer ? I'm prefer first option (it's probably easier to write too since it does not cross project boundaries).
from node-rcs-core.
Related Issues (20)
- False positive
- More consistent stats
- Remove `options.extend`
- Apply fix from v2.6.3 into master
- Remove `merge` wherever possible
- `_conflict` should get handled differently HOT 4
- [Feature request] Optimize replacement HOT 1
- Add dev mode
- Sourcemaps
- Add new test case
- Is there a safe way to allow certain CSS class names on a case-by-case basis? HOT 4
- Branch: master -> main
- How to include class names containing colon HOT 4
- Class names with square brackets and escaped characters HOT 2
- Problem with noscript tag HOT 5
- Twig templates support HOT 1
- A problem with renaming CSS variables HOT 1
- Multiple class selectors on same element in a PHP file HOT 6
- Regarding Updating Major Espree Version - HOT 4
- Does not prefix classes named after html elements? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-rcs-core.