
Security News
Risky Biz Podcast: Making Reachability Analysis Work in Real-World Codebases
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
compass-placeholders
Advanced tools
@extendable %placeholders for common CSS3 code provided by Compass.
For example use @extend %hide-text;
instead of @include hide-text;
this
@import "compass";
a.first-link {
@include hover-link;
}
a.second-link {
@include hover-link;
}
Result:
a.first-link {
text-decoration: none;
}
a.first-link:hover {
text-decoration: underline;
}
a.second-link {
text-decoration: none;
}
a.second-link:hover {
text-decoration: underline;
}
@import "compass";
@import "compass-placeholders";
a.first-link {
@extend %hover-link;
}
a.second-link {
@extend %hover-link;
}
Result (DRY – don’t repeat yourself):
a.first-link,
a.second-link {
text-decoration: none;
}
a.first-link:hover,
a.second-link:hover {
text-decoration: underline;
}
@extend %appearance-none;
@extend %appearance-normal;
@extend %appearance-icon;
@extend %appearance-window;
@extend %appearance-button;
@extend %appearance-menu;
@extend %appearance-field;
@extend %background-clip-padding-box;
@extend %background-clip-border-box;
@extend %background-clip-text;
@extend %background-origin-padding-box;
@extend %background-origin-border-box;
@extend %background-origin-content-box;
@extend %no-border-radius; // equals border-radius: 0
// Create placeholders for border-radius by setting:
$border-radius-placeholders: 0, 3px, 10px;
// Which results in:
@extend %border-radius-0;
@extend %border-radius-3px;
@extend %border-radius-10px;
// You should prefer to use custom names like %small-border-radius
// and %big-border-radius over those listed above.
@extend %display-box;
@extend %box-orient-horizontal;
@extend %box-orient-vertical;
@extend %box-orient-inline-axis;
@extend %box-orient-block-axis;
@extend %box-orient-inherit;
@extend %box-align-start;
@extend %box-align-end;
@extend %box-align-center;
@extend %box-align-baseline;
@extend %box-align-stretch;
@extend %box-direction-normal;
@extend %box-direction-reverse;
@extend %box-direction-inherit;
@extend %box-lines-single;
@extend %box-lines-multiple;
@extend %box-pack-start;
@extend %box-pack-end;
@extend %box-pack-center;
@extend %box-pack-justify;
// Customize list by setting:
$box-orient-placeholders: horizontal;
$box-align-placeholders: start;
$box-direction-placeholders: normal;
$box-lines-placeholders: single;
$box-pack-placeholders: start, end;
$box-flex-placeholders: 0, 1;
$box-flex-group-placeholders: 1, 2;
$box-ordinal-group-placeholders: 1, 2;
@extend %no-box-shadow;
@extend %box-sizing-content-box;
@extend %box-sizing-border-box;
@extend %transparent;
@extend %opaque;
// Create placeholders for opacity:
$opacity-placeholders: 0.25, 0.5;
// Which results in:
@extend %opacity-25;
@extend %opacity-50;
@extend %no-text-shadow;
@extend %transform-style-flat;
@extend %transform-style-preserve-3d;
@extend %backface-visibility-visible;
@extend %backface-visibility-hidden;
@extend %user-select-none;
@extend %user-select-text;
@extend %user-select-toggle;
@extend %user-select-element;
@extend %user-select-elements;
@extend %user-select-all;
@extend %user-select-inherit;
@extend %hover-link;
@extend %unstyled-link;
@extend %no-bullet;
@extend %no-bullets;
@extend %inline-list;
@extend %ellipsis;
@extend %no-ellipsis;
@extend %force-wrap;
@extend %nowrap;
@extend %hide-text;
@extend %squish-text;
@extend %clearfix;
@extend %pie-clearfix;
@extend %no-background; // equals background: transparent
@extend %no-border; // equals border: 0
@extend %no-margin; // equals margin: 0
@extend %no-padding; // equals padding: 0
@extend %display-none;
@extend %display-block;
@extend %display-inline;
@extend %display-inline-block;
@extend %display-table;
@extend %display-table-cell;
@extend %display-table-row;
@extend %font-weight-bold;
@extend %font-weight-normal;
@extend %font-style-italic;
@extend %font-style-normal;
@extend %text-decoration-underline;
@extend %text-decoration-none;
@extend %text-align-left;
@extend %text-align-center;
@extend %text-align-right;
@extend %text-align-justify;
@extend %text-transform-none;
@extend %text-transform-capitalize;
@extend %text-transform-uppercase;
@extend %text-transform-lowercase;
@extend %text-transform-full-width;
@extend %cursor-default;
@extend %cursor-pointer;
@extend %float-none;
@extend %float-left;
@extend %float-right;
@extend %list-style-none;
@extend %list-style-image-none;
@extend %list-style-position-inside;
@extend %list-style-position-outside;
@extend %list-style-type-disc;
@extend %list-style-type-circle;
@extend %list-style-type-square;
See this blog post for details.
@extend %vertical-align;
Some placeholders/value combinations are optionional. For example the
appearance
will have placeholders for none
and normal
by default:
@import "compass";
@import "compass-placeholders";
.my-class {
@extend %border-radius-none; // OK (as `none` is in the default list`)
@extend %border-radius-3px; // Error
}
You need to set the customized list before you call @import "compass-placeholders";
:
$border-radius-placeholders: none, 3px;
@import "compass";
@import "compass-placeholders";
.my-class {
@extend %border-radius-none; // OK
@extend %border-radius-3px; // OK
}
First install the gems and create a project:
gem install compass
gem install compass-placeholders --pre
compass create my-project
Second add to your my-project/compass.rb:
# compass.rb
require "compass-placeholders"
Third import Compass-Placeholders after Compass in your Sass/SCSS file:
// Custom list variables go first:
$appearance-placeholders: none, normal;
// Then imports:
@import "compass";
@import "compass-placeholders";
// And start extending:
a {
@extend %hover-link;
}
Copyright (c) 2012 – 2014 Nico Hagenburger. See MIT-LICENSE.md for details. Follow me on Twitter.
FAQs
Unknown package
We found that compass-placeholders demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.