How to use the color-shorthand-hex-to-six-digit function in color-shorthand-hex-to-six-digit

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 3 months ago

Package Health Score

78 / 100
Full package analysis

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