Giter Club home page Giter Club logo

Comments (5)

MoOx avatar MoOx commented on June 13, 2024

See preserve and appendVariables options to do this.

from postcss-custom-properties.

athyuttamre avatar athyuttamre commented on June 13, 2024

Thanks!

For future readers: I ran my CSS through this module with preserve: "computed" as well as postcss-calc to resolve all the variables. Then I used the css npm module to parse through the tree, find :root selectors, and find all declarations inside that started with --.

You can also see an example in https://www.npmjs.com/package/css-variables-loader.

from postcss-custom-properties.

MoOx avatar MoOx commented on June 13, 2024

Why don't you "just" use postcss itself, instead of css module (which is what is used for... rework!).

from postcss-custom-properties.

athyuttamre avatar athyuttamre commented on June 13, 2024

Haha, fair point. I'm running the CSS through postcss within webpack, but the JSON is being generated in a loader. I want to distribute the loader separately, so the less dependencies there the better. postcss is heavier than just the css module. :)

from postcss-custom-properties.

emattias avatar emattias commented on June 13, 2024

@athyuttamre How come you didn't use the https://www.npmjs.com/package/css-variables-loader that you linked to? :)

from postcss-custom-properties.

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.