How to use color-shorthand-hex-to-six-digit - 2 common examples

To help you get started, we’ve selected a few color-shorthand-hex-to-six-digit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sbekrin / styled-email-components / src / mail-style.js View on Github external
return Object.keys(style).reduce((acc, rule) => {
        // Transform unitless numbers to pixels
        if (typeof style[rule] === 'number') {
          if (['lineHeight'].includes(rule)) {
            return { ...acc, [rule]: style[rule].toString() };
          }
          return { ...acc, [rule]: `${style[rule]}px` };
        }
        // Expand hex colors
        if (rule.toLowerCase().includes('color')) {
          return { ...acc, [rule]: expandHexColor(style[rule]) };
        }
        return { ...acc, [rule]: style[rule] };
      }, {});
    }
github sbekrin / styled-email-components / src / css-to-style.js View on Github external
.reduce((out, [name, value]) => {
        return {
          ...out,
          [camelizeStyleName(name)]: /color/i.test(name)
            ? expandHexColor(value)
            : value,
        };
      }, {})
  );

color-shorthand-hex-to-six-digit

Convert shorthand hex color codes into full

MIT
Latest version published 11 months ago

Package Health Score

61 / 100
Full package analysis

Popular color-shorthand-hex-to-six-digit functions