intuit / postcss-themed

A PostCSS plugin for generating themes.
MIT License
62 stars 32 forks source link

add ability to use a default function for modules #34

Closed enzozafra closed 3 years ago

enzozafra commented 3 years ago

What Changed

Add a default function to use for modules. I made an assumption that the default to be used is the function that was in the README. This is:

const defaultLocalizeFunction = (
  name: string,
  filePath: string,
  css: string
) => {
  const hash = crypto
    .createHash('md5')
    .update(css)
    .digest('hex')
    .slice(0, 6);
  return `${filePath || 'default'}-${name}-${hash}`;
}

I updated the README to reflect how to use this default function and replaced the 'custom' function in the README to avoid confusion.

Why

https://github.com/intuit/postcss-themed/issues/25

Todo:

enzozafra commented 3 years ago

Seems to be some token issue for the last stage of CircleCI. Let me know if I need to do anything about it!

hipstersmoothie commented 3 years ago

:rocket: PR was released in v2.1.0 :rocket: