respec allows CSS authors to assign the specificity of a rule separately from the specificity of the selector
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
tests Add initial files Oct 8, 2017
LICENSE Initial commit Oct 8, 2017
README.md Add JIF (pronounced 'GIF') Oct 8, 2017
index.html Add initial files Oct 8, 2017
respec-logo.svg Add initial files Oct 8, 2017
respec.js Update respec.js Oct 8, 2017

README.md

respec

Respec allows CSS authors to assign a specificity level to the rules they write separate from the specificity of the selector

Inspired by https://github.com/w3c/csswg-drafts/issues/1170

Syntax

respec(selector, specificity, rule)
  • selector is a CSS selector
  • specificity is a number 0 or greater
  • rule is one or more CSS declarations separated by semicolons

Example

respec('div', 3, 'background: lime;')

Website