K
K
Kizzeon2020-05-17 15:06:35
css
Kizzeon, 2020-05-17 15:06:35

How to implement regex for "@media" inside css file?

I want to select from the file those scattered throughout the file and insert them at the end of the file. That is, the template text looks like this:@media


@media(min-width: 992px){
  .container{
    styles
  }
  .container2{
    styles
  }
}


How can I select all media queries of this kind in a file (including all classes inside)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Morev, 2020-05-17
@SeaInside

Next time before creating a question, try googling it first.
In your case, something like "regex match css media query", and the first link on the stack will find what you are looking for.
The ability to immediately correctly formulate a request is just a developer skill (and one of the most important) to develop - you just need to practice more.
Good luck :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question