parcel-bundler / parcel-bundler/lightningcss
Option to not add units of measure
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 7.7k
- Forks
- 302
- PR merge metrics
- No merged PRs in 30d
Description
Currently
a{width:1}
becomes
a{width:1px}
which breaks my UI by turning invalid CSS into a valid one.
(Of course the right thing to do is to fix my origin code to not contain invalid CSS. But in a large project that may take a while and hurt the adoption of LightningCSS.)
I think in this case the correct behavior would be to drop the property completely as its value is incorrect.
Contributor guide
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
In the Rust CSS parser/transformer, locate the logic that adds px units to unitless values and any tests covering width declarations. First run the relevant existing test suite, then determine where an option can control this behavior. Done means the option prevents invalid unitless declarations from becoming valid CSS and has coverage for the reported example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css, rust
- Domain
- compilers, frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100