All files / plugins colors.js

100% Statements 3/3
100% Branches 0/0
100% Functions 0/0
100% Lines 3/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 263x   3x   3x                                          
const {createVariableRule} = require('./lib/variable-rules')
 
const bgVars = ['$bg-*', '$tooltip-background-color']
 
module.exports = createVariableRule('primer/colors', {
  'background-color': {
    expects: 'a background color variable',
    values: bgVars.concat('none', 'transparent')
  },
  background: {
    expects: 'a background color variable',
    values: bgVars.concat('none', 'transparent', 'top', 'right', 'bottom', 'left', 'center', '*px', 'url(*)')
  },
  'text color': {
    expects: 'a text color variable',
    props: 'color',
    values: ['$text-*', '$tooltip-text-color', 'inherit'],
    replacements: {
      '#fff': '$text-white',
      white: '$text-white',
      '#000': '$text-gray-dark',
      black: '$black'
    }
  }
})