MadLittleMods / MadLittleMods/postcss-css-variables
Define global variables as css file
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 551
- Forks
- 63
- PR merge metrics
- No merged PRs in 30d
Description
It's just a suggestion for implement.
Now global variables defined as 'variables' in options. And it is an js object.
For me it would be better to import variables as file instead, for example:
options: { variablesPath: 'src/variables.css' }
P.S. Why I need it:
It's because I use css-modules and have no way to set variables declarations somewhere top.
It is possible to import variables from every file which needs them, but I'm using variables as a method to decouple components from global files :) As a context for component...
The solution I use for now is implicitly importing of variables file in sass-loader.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the option handling for the existing variables JavaScript object and trace how variable declarations are processed. Define how options.variablesPath should load src/variables.css, including its interaction with CSS Modules, then verify that variables imported through the path produce the same transformed output as the current option.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css, javascript
- Domain
- frontend, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100