Replace 'palletes' with 'colours' which is a bit more intuitive and is also spelt correctly.

This commit is contained in:
Brabli
2023-05-30 17:18:33 +01:00
parent b66e7821a7
commit 633e4a284e
7 changed files with 50 additions and 52 deletions

View File

@@ -14,7 +14,7 @@ Example config:
pcm_icon:
directories:
- '%kernel.project_dir%/public/icons'
palletes:
colours:
primary:
fill: 'fill-primary'
stroke: 'stroke-primary'
@@ -33,10 +33,10 @@ pcm_icon:
`directories` - Which directories to look in for icons.
`palletes` - Custom colour palletes to use when colouring icons. Because this extension relies on Tailwind classes for colouring we must specify all the classes. This is annoyingly verbose, but you can just copy this template:
`colours` - Custom colours to use when colouring icons. Because this extension relies on Tailwind classes for colouring we must specify all the classes. This is a bit awkward, but you can just copy this template replacing COLOUR as appropriate:
```yaml
PALLETE_NAME:
COLOUR:
fill: 'fill-COLOUR'
stroke: 'stroke-COLOUR'
fill-hover: 'hover:fill-COLOUR'
@@ -53,7 +53,7 @@ PALLETE_NAME:
`size (int)` Size of the icon in pixels
`colour (string)` Name of the main colour pallete to use. Defaults to `"primary"`, which is a pallete that uses the project's primary colour. If however you are not using `primary` to set a Tailwind primary colour in your project, you can instead set the default colour of the icon by changing what colour classes the primary pallete uses. EG:
`colour (string)` Name of the colour to use. Defaults to `primary` as it assumes you have a Tailwind colour set up called `primary`. If however you are not using `primary` to set a Tailwind primary colour in your project, you can instead set the default colour of the icon by changing what colour classes the primary colour uses. EG:
```yaml
primary:
fill: 'fill-purple-700'
@@ -64,9 +64,9 @@ primary:
stroke-group-hover: 'group-hover:stroke-purple-700'
```
`hover (string)` Name of the colour pallete to use when the icon is hovered over
`hover (string)` Name of the colour to use when the icon is hovered over
`classes (string[])` Additional classes to add to the icon. This can cause Tailwind class collisions, so use with caution if at all.
`classes (string[])` Additional classes to add to the icon. This can cause Tailwind class collisions, so only use it as a last resort.
## Reminders
Remember to add `./config/packages/*.yaml` as a value in your Tailwind config content array if it does not already exist. This will ensure Tailwind classes inside of the config file get compiled.