preview-icons.mjs 745 B

12345678910111213141516171819202122232425
  1. import { globSync } from 'glob'
  2. import { GITHUB_DIR, generateIconsPreview, ICONS_SRC_DIR, asyncForEach } from './helpers.mjs'
  3. import path from 'path'
  4. const types = {
  5. '-outline': 'outline',
  6. '-filled': 'filled',
  7. '': '**'
  8. }
  9. asyncForEach(Object.entries(types), async ([type, dir]) => {
  10. const files = globSync(path.join(ICONS_SRC_DIR, `${dir}/*.svg`)).sort((a, b) => path.basename(a).localeCompare(path.basename(b)))
  11. await generateIconsPreview(files, path.join(GITHUB_DIR, `preview/icons${type}.svg`), {
  12. retina: false,
  13. stroke: 1.5
  14. })
  15. await generateIconsPreview(files, path.join(GITHUB_DIR, `preview/icons${type}-dark.svg`), {
  16. color: '#ffffff',
  17. background: 'transparent',
  18. retina: false,
  19. stroke: 1.5
  20. })
  21. })