Creating or referencing variables dynamically in Sass

This is actually possible to do using SASS maps instead of variables. Here is a quick example: Referencing dynamically: $colors: ( blue: #007dc6, blue-hover: #3da1e0 ); @mixin colorSet($colorName) { color: map-get($colors, $colorName); &:hover { color: map-get($colors, #{$colorName}-hover); } } a { @include colorSet(blue); } Outputs as: a { color:#007dc6 } a:hover { color:#3da1e0 } Creating … Read more

Placeholder Mixin SCSS/CSS

You’re looking for the @content directive: @mixin placeholder { ::-webkit-input-placeholder {@content} :-moz-placeholder {@content} ::-moz-placeholder {@content} :-ms-input-placeholder {@content} } @include placeholder { font-style:italic; color: white; font-weight:100; } SASS Reference has more information, which can be found here: http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#mixin-content As of Sass 3.4, this mixin can be written like so to work both nested and unnested: @mixin … Read more

Calculate a percent with SCSS/SASS

Have you tried the percentage function ? $my_width: percentage(4/12); div{ width: $my_width; } UPDATE This function was updated since version 1.33.0 and now this is a correct method to do it: @use “sass:math”; div { width: math.percentage(math.div(4,12)); } Source: https://sass-lang.com/documentation/modules/math#percentage

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)