Giter Club home page Giter Club logo

Comments (4)

 avatar commented on August 27, 2024

This will be awesome, how do you plan on storing the whitespace?

Will it be possible to serialize specific rulesets, rules etc?

css.cssRules[0].serialize()                // => "h1 { \n  color:  red;\n\n  background: blue;\n}"
css.cssRules[0].style[0].serialize()       // => "color:  red;"
css.cssRules[0].style[0].value.serialize() // => "red"

This combined with a way to determine the index in the original text would be quite powerful. Each rule could contain an integer offset within it's parent, this way you could get a "live" index by summing all the previous sibling offsets and parent offsets:

css.cssRules[0].style[0].index()       // => Rule's index within the css text that was parsed
css.cssRules[0].style[0].value.index() // => Value's index within the css text that was parsed

from cssom.

NV avatar NV commented on August 27, 2024

Yes, yes, and yes. I hope to release it on the next weekends.

from cssom.

 avatar commented on August 27, 2024

Excellent! Will the whitespace be stored as separate nodes/objects?

I mentioned in a previous ticket adding support for Less-style nested rules which I can see now doesn't really belong in this project. What would be nice is a way to plug in addition features like this, it there likely to be an API with hooks allowing this kind of thing as I don't really fancy forking the project just for this?

Also lack of older IE support is a bit of an issue in my use case, would you accept a patch with a kind of ieCompat option? It would obviously have to get around getters and setters in another way.

from cssom.

kizu avatar kizu commented on August 27, 2024

Any news on this? Especially on comments — the CSSOM is used in Stylus' CSS to Stylus convertor and the lack of them in there is bad, 'cause we want them to stay there in the code after conversion :(

from cssom.

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.