I am in search of a reliable method to extract a rule by class selector from a .scss file in order to display it on the Angular app ui. So far, I have not been able to find a suitable parser for .scss that can be used specifically for retrieving a class rule by its name.
For example: If I specify the class selector as 'custom-class', I simply need the content within the curly brackets.
.custom-class {
width: 334px;
text-decoration: underline;
}
Are there any typings available for scss that could be utilized? Or are there any npm packages out there where I can input the file path and the class name for which the rule content should be extracted from the scss file?
One such package is https://www.npmjs.com/package/list-css-selectors which can list the class selectors, however, it works for css files and not for fetching class content from scss files.