2.0.2 • Published 12 months ago

svg-color-replace v2.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
12 months ago

SVG Color Replace

This action replaces colors in SVG files with CSS variables coming from a JSON color token set.

Inputs

NameDescriptionRequiredDefault
svg-folder-pathThe path to the folder containing the SVG files.YesN/A
token-set-input-pathsThe path to the JSON file containing the color token set.YesN/A
base-token-set-input-pathThe path to the JSON file containing the base color token set.YesN/A
dry-runWhether to run the action without modifying the files.Nofalse
token-set-keysThe keys to use from the token set.NoN/A
prefer-deep-keyWhether to prefer deep keys over shallow keys.Nofalse
file-extensionsThe file extensions to process.No["*"]
inject-into-htmlWhether to inject the CSS file into the HTML file.Nofalse
html-pathThe path to the HTML file to inject the CSS file into.NoN/A
css-file-output-folder-pathThe path to the folder to output the CSS file to.NoN/A
css-file-href-prefixThe prefix to use for the CSS file href.NoN/A
svg-output-folder-pathThe path to the folder to output the modified SVG files to.NoN/A
mark-generated-filesWhether to mark the generated files. (.generated. in file name)Nofalse

Example usage

Check the repo for the latest release. This version number is just an example.

name: Replace colors in SVG files
on:
  push:
    branches:
      - main
jobs:
  replace-svg-colors:
    runs-on: ubuntu-latest
    steps:
      - name: Replace colors in SVG files
        uses: nbotond20/svg-color-replace@v1.0.0
        with:
          svg-folder-path: 'path/to/svg/folder'
          token-set-input-paths: |
            ["path/to/color/token/set.json", "path/to/other/color/token/set.json"]
          base-token-set-input-path: 'path/to/base/color/token/set.json'
          dry-run: false
          token-set-keys: '["color"]'
          prefer-deep-key: false
          file-extensions: '[".svg"]'
          inject-into-html: false
          html-path: 'path/to/html/file'
          css-file-output-folder-path: 'path/to/css/folder'
          css-file-href-prefix: 'path/to/css/folder'
2.0.2

12 months ago

2.0.1

12 months ago

1.1.10

12 months ago

1.0.1

12 months ago

1.0.0

12 months ago