Comments (4)
Unfortunately I think ^ is correct. Nonetheless, maybe we could render whatever is defined on :root?
from cssstats.
Custom properties are evaluated by the browser at 'runtime', meaning that var(--my-custom-property)
could have different calculated values, based on the place it has in the document, the default/fallback value and probably some other cases I'm not thinking of at the moment.
CSSStats does not know about all this context, because all it analyzes is the raw CSS it encounters on a given page. It would be impossible to render the variables correctly based only on the CSS.
But perhaps there's something I'm missing here? 🤔
from cssstats.
from cssstats.
Thanks for bubbling this up @lachlanjc!
The CSS AST has enough information for most custom property handling, though ofc it misses anything affected by a runtime since this tool works purely statically (by design).
v4 now contains a fix that should address 90% or so of variable/custom property usage. It still missed nested variables, but that's something for another day I think so I'm going to close this. Thanks all!
from cssstats.
Related Issues (20)
- Specificity graph not visible in dark mode HOT 2
- Some sites fail to analyze HOT 12
- 502 bad gateway against a site HOT 1
- Location of reported items in source CSS [FEATURE REQUEST] HOT 2
- How to copy paste CSS code and then analyzie via CSSstats? HOT 1
- `/stats` endpoint is accessible and shows infinite loading HOT 2
- Impossible have stats in authenticated pages HOT 6
- Unexpected error occured HOT 1
- Remove CSS field in stats response for the API
- Feature Rewu
- Adding custom user agent to request HOT 1
- Blank page when trying to analyze a certain css file HOT 8
- [BUG] Failing to collect selectors with declaration that only has custom properties HOT 3
- Failing URLs
- Failing URL
- No longer maintained? HOT 2
- The website is crashed after typing a url address HOT 1
- Skins section appears twice
- Export found values as JSON HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cssstats.