Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Create REM fallback in a mixin – SCSS

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #43267
    croydon86
    Participant

    Hi guys,

    I have recently started using SASS and pretty new to writing mixins.

    I am trying to create some generic classes and would like to use REM units, but also providing a pixel fallback.

    Here is a codepen – http://codepen.io/anon/pen/ulopB

    As you can see I have set the main value as a variable, and am using this variable in the classes, but this is only outputting REM, how can I output so there is a pixel fallback using a mixin?

    I have seen this article https://gist.github.com/drublic/4374738 but this is for font sizes

    Thanks in advance

    #127594
    croydon86
    Participant

    Ok I have figured it out here, http://codepen.io/anon/pen/mlsuh

    Feel free to comment if there is a more efficient way to to do this.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘CSS’ is closed to new topics and replies.