Skip to content
This repository has been archived by the owner on Aug 6, 2021. It is now read-only.

how to modify parsed css? #31

Open
aloksharma1 opened this issue Jun 28, 2020 · 0 comments
Open

how to modify parsed css? #31

aloksharma1 opened this issue Jun 28, 2020 · 0 comments

Comments

@aloksharma1
Copy link

aloksharma1 commented Jun 28, 2020

hi,
i have a requirement where i want to modify the parsed css and then replace it in style tag,
for example:

<style id="customCss">
.someClass {
  margin : 20px;  
}
@media (max-width: 600px) {
  .someClass {
  margin : 5px;  
}
}
</style>

i want to parse rule without media query, and modify it and then replace it back in style tag, how to achieve that?

basically i want this to turn into following output:

<style id="customCss">
.someClass {
  margin : 10px;  
  padding:5px;
}
@media (max-width: 600px) {
  .someClass {
  margin : 5px;  
  padding:0;
}
}
</style>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant