Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is scss-parser maintained ? #45

Open
Drozerah opened this issue Mar 28, 2022 · 0 comments
Open

is scss-parser maintained ? #45

Drozerah opened this issue Mar 28, 2022 · 0 comments

Comments

@Drozerah
Copy link

npm i 'scss-parser' 

Then

let { parse, stringify } = require('scss-parser')

// Create an AST from a string of SCSS
let ast = parse('.hello { color: $red; }')
// Modify the AST (see below for a better way to do this)
ast.value[0].value[0].value[0].value[0].value = 'world'
// Convert the modified AST back to SCSS
let scss = stringify(ast) // .world { color: $red; }

won't return .world { color: $red; } but .hello { color: $red; }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant