What does % mean in SASS?

https://sass-lang.com/documentation/style-rules/placeholder-selectors Placeholder Selectors: %foo Sass supports a special type of selector called a “placeholder selector”. These look like class and id selectors, except the # or . is replaced by %. They’re meant to be used with the @extend directive; for more information see @extend-Only Selectors. On their own, without any use of @extend, rulesets … Read more

Styling a specific set of input types in a reusable way with Sass

Your problem might better be solved by using variables to contain your selectors. By using a mixin, you’re losing the ability to chain it with similar elements. $form-input-text: ‘input[type=”text”], input[type=”password”], input[type=”search”], input[type=”email”], input[type=”tel”], input[type=”url”]’; $form-input-buttons: ‘input[type=”submit”], input[type=”reset”], input[type=”button”], button’; $form-input-dates: ‘input[type^=”date”], input[type=”month”], input[type=”week”], input[type=”time”]’; $form-input-not-radio: ‘input:not([type=”radio”]):not([type=”checkbox”])’; #{$form-input-text}, textarea { @include border-radius(.25em); border: $form-input-border; } #{$form-input-text}, … Read more

Unexpected results when using @extend for themes

Extends, as you’ve already discovered, can get rather messy. I would go about solving your problem by using an @content aware mixin in combination with global variables (this uses mappings, which are part of 3.3… you can do it with lists of lists, but it’s a little less elegant): $base-color: null; // don’t touch $accent-color: … Read more

Configure compass browser support (Compass 1.x syntax)

Excluding browsers is done by modifying the $graceful-usage-threshold variable. If Browser X only has 4.99% of the market share, you want to set it to 5. $debug-browser-support: true; $browser-minimum-versions: ( “ie”: “9” ); $graceful-usage-threshold: 4.46163; @import “compass”; .foo { @include opacity(.5); @include border-radius(10px); } Output: .foo { /* Content for ie 8 omitted. Minimum support … Read more

SASS compile fontawesome preserve notation

Extract from Sass 3.4.0 changelog: Sass now follows the CSS Syntax Level 3 specification for determining a stylesheet’s encoding. In addition, it now only emits UTF-8 CSS rather than trying to match the source encoding. Now no way for use old method Issue on SASS repo For me, rollback to SASS 3.3.14 fix this

Interpolation of prefixes on @keyframes in Sass

This simply isn’t possible using variable interpolation. You can get around the @ assignment like this: $at: unquote(“@”); // either of these will work $amp: #{“@”}; But then you end up with this error: error sass/test.scss (Line 4: Invalid CSS after “”: expected selector_comma_sequence, was “@-ms-keyframes …”) Interpolation on @keyframes is not currently supported, but … Read more