All Projects → salesforce-ux → Sass Deprecate

salesforce-ux / Sass Deprecate

Licence: bsd-3-clause
Let Sass warn you about the pieces of your UI that are deprecated, providing a clear upgrade path for developers

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Sass Deprecate

Sassessentials
Repository for my tutorial course: Sass Essential Training on LinkedIn Learning and Lynda.com.
Stars: ✭ 167 (-36.98%)
Mutual labels:  scss, sass, sass-mixins
Breakpoint Slicer
Slice media queries with ease
Stars: ✭ 332 (+25.28%)
Mutual labels:  scss, sass, sass-mixins
Juice
Mixins for Life
Stars: ✭ 274 (+3.4%)
Mutual labels:  scss, sass, sass-mixins
Sassyfication
💅Library with sass mixins to speed up your css workflow.
Stars: ✭ 51 (-80.75%)
Mutual labels:  scss, sass, sass-mixins
Sscss
Light Sass lib for managing your font-size, margin, padding, and position values across breakpoints.
Stars: ✭ 119 (-55.09%)
Mutual labels:  scss, sass, sass-mixins
Bourbon
Bourbon is maintained by the thoughtbot design team. It is funded by thoughtbot, inc. and the names and logos for thoughtbot are trademarks of thoughtbot, inc.
Stars: ✭ 9,065 (+3320.75%)
Mutual labels:  scss, sass, sass-mixins
Sassmagic
Collection best of Sass mixins and function
Stars: ✭ 795 (+200%)
Mutual labels:  scss, sass, sass-mixins
Css Vars
Sass mixin to use CSS Custom Properties with Sass
Stars: ✭ 164 (-38.11%)
Mutual labels:  scss, sass, sass-mixins
Sass Extras
Useful utilities for working with Sass
Stars: ✭ 179 (-32.45%)
Mutual labels:  scss, sass, sass-mixins
Css
Believe in Better CSS
Stars: ✭ 262 (-1.13%)
Mutual labels:  scss, sass
Bslib
Tools for theming shiny and rmarkdown from R via Bootstrap (3 or 4) Sass.
Stars: ✭ 197 (-25.66%)
Mutual labels:  scss, sass
Style Resources Loader
CSS processor resources loader for webpack
Stars: ✭ 214 (-19.25%)
Mutual labels:  scss, sass
Typed Scss Modules
🎁 Generate type definitions (.d.ts) for CSS Modules using SCSS
Stars: ✭ 192 (-27.55%)
Mutual labels:  scss, sass
Nuxt Sass Resources Loader
SASS resources (e.g. variables, mixins etc.) module for NuxtJs
Stars: ✭ 191 (-27.92%)
Mutual labels:  scss, sass
Django Static Precompiler
Django Static Precompiler provides template tags and filters to compile CoffeeScript, LiveScript, SASS / SCSS, LESS, Stylus, Babel and Handlebars. It works with both inline code and external files.
Stars: ✭ 206 (-22.26%)
Mutual labels:  scss, sass
Include Media
📐 Simple, elegant and maintainable media queries in Sass
Stars: ✭ 2,362 (+791.32%)
Mutual labels:  scss, sass
Gulp Pug Starter
Frontend development with pleasure. Pug + SCSS version
Stars: ✭ 228 (-13.96%)
Mutual labels:  scss, sass
Rsass
Sass reimplemented in rust with nom.
Stars: ✭ 227 (-14.34%)
Mutual labels:  scss, sass
Iota
A responsive micro-framework for the grid spec powered by CSS custom properties.
Stars: ✭ 189 (-28.68%)
Mutual labels:  scss, sass
Griddle
A CSS Grid Framework
Stars: ✭ 215 (-18.87%)
Mutual labels:  scss, sass

Deprecate with confidence Build Status Greenkeeper badge

deprecate() is a Sass mixin that helps managing code deprecation.

How? Sass Deprecate warns about the pieces of your codebase that are deprecated, instructing developers where to clean up. It helps provide a clear upgrade path for framework and library users.

We (the Salesforce UX team) built this tool to help us deprecate code with confidence in the Lightning Design System.

Getting started

Here is a typical workflow in which deprecate() comes in handy:

v1.0.0

Consider a Sass style guide in v1.0.0, button:

$app-version: '1.0.0';
@import 'path/to/deprecate/index.scss';

.button { background: red; }

v1.1.0

We're introducing a new type of button, but we want to keep the old one in the code for backwards compatibility.

$app-version: '1.1.0';
@import 'path/to/deprecate/index.scss';

@include deprecate('2.0.0', 'Use .button-new instead') {
  .button { background: red; }
}
.button-new { background: red; border: 3px solid blue; }
/* Compiled CSS */
.button { background: red; }
.button-new { background: red; border: 3px solid blue; }

v2.0.0

Major update: we don't want to ship deprecated code, and this is where Sass Deprecate comes into play:

$app-version: '2.0.0';
@import 'path/to/deprecate/index.scss';
...

The compiler will start throwing warnings, such as:

WARNING: Deprecated code was found, it should be removed before its release.
REASON:  Use .button-new instead
	on line 145 of index.scss
	from line 5 of button.scss

And the compiled CSS won't include .button:

/* Compiled CSS */
.button-new { background: red; border: 3px solid blue; }

Advanced Semantic Versioning Support

Need to compare version numbers such as 3.2.1-beta.5 and 1.2.3-alpha.2?

By default, sass-deprecate only compares $version with $app-version in the form of Major.Minor.Patch (e.g. 1.2.3 with 2.0.0).

For advanced SemVer support in the form of Major.Minor.Patch-beta/alpha/rc.1, define a deprecate-version-greater-than($v1, $v2) function, or rely on Hugo's sass-semver:

// Override the default SemVer resolution engine
// with sass-semver: https://github.com/HugoGiraudel/sass-semver
@import 'node_modules/sass-semver/index';

@function deprecate-version-greater-than($version, $app-version) {
  @return gt($v1: $version, $v2: $app-version);
}

@import 'path-to/sass-deprecate/index';

Running tests

Clone the repository, then:

npm install
npm test

Generating the documentation

Sass Deprecate's API is documented using SassDoc.

npm run generate-doc

Generate & deploy the documentation to https://salesforce-ux.github.io/sass-deprecate/:

npm run deploy-doc

Mentioned in

Acknowledgments

Thanks to Hugo Giraudel for his to-number Sass function.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].