Grow your CSS skills. Land your dream job.

Regular expression to get sass imports.

  • # April 13, 2013 at 1:17 pm

    Hi guys can you provide me regular expression to match sass and scss style @imports.

    I have tried

    /@import[s"']*([^"';n]+)[;"']*/g

    But it is giving me only the first @import of list

    @import “mainstyle”,
    “header”,
    “typography”,
    “somethingelese.scss”;

    It is giving me just mainstyle not the other ones. Please help.

    Here is the [pen](http://codepen.io/subash/pen/koCvm) on codepen.

    # April 14, 2013 at 5:30 am

    Solved myself. Not the best solution but works.

    http://codepen.io/subash/pen/koCvm

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".