Giter VIP home page Giter VIP logo

Comments (1)

X-Ryl669 avatar X-Ryl669 commented on August 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.