sass / dart-sass

The reference implementation of Sass, written in Dart.
https://sass-lang.com/dart-sass
MIT License
3.96k stars 360 forks source link

Creating a report of all defined variables #2327

Closed lazytyper closed 2 months ago

lazytyper commented 2 months ago

I am working on my own SCSS framework, which should consist of importable modules and overwritable variables. Import files can also contain such variables.

I've been looking for a way to output all variables, but haven't found one yet.

The advantage would have been: you could create an overview/documentation with all the variables used and their values. The list would also make it easier to optimize the framework.

Such a list could be generated by procuding a different output. Instead of a creating CSS code, a report could be generated:

Whenever a variable is defined or overwritten, a line or data set is output, with

Goodwine commented 2 months ago

Hello, this request is something we won't be implementing as part of the main Sass repo.

However, I believe you can use SassDoc to generate a document with some of the data you're looking for. Otherwise, you'll have to develop your own tool to extract the data you're looking for.

Goodwine commented 2 months ago

By the way, if you're looking to implement a tool yourself that does this, you can use the sass_api (Dart) to process your Sass files.