Skip to content

Commit

Permalink
docs(theme): updated docs for adding new color
Browse files Browse the repository at this point in the history
  • Loading branch information
jd-solanki committed Feb 19, 2023
1 parent 053e034 commit e75d414
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
19 changes: 17 additions & 2 deletions docs/guide/features/theme.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,24 @@ app.use(anu, {

Passing options to anu config will merge them and will result in new color **secondary** added to existing theme palette.

Additionally, You also have to add this new color in Anu's UnoCSS preset.
Additionally, You also have to add this new color in Anu's UnoCSS preset option as styles are generated via UnoCSS.

> _Working on omitting this preset step. Guide WIP._
```ts
// file: uno.config.ts

import { presetAnu } from 'anu-vue'
import { defineConfig } from 'unocss'

export default defineConfig({
presets: [
// other presets
presetAnu({
// Add new color, It will get merged with existing colors
colors: ['secondary'],
}),
]
})
```

Finally let's use new color 馃槏

Expand Down
4 changes: 0 additions & 4 deletions packages/anu-vue/src/preset/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,9 @@ export function presetAnu(options: Partial<typeof presetDefaults> = {}): Preset
),
},
safelist: [
// TODO: We can remove this color safelist if we use leverage `--a-color` CSS var
..._options.colors.map(c => `bg-${c}`),
..._options.colors.map(c => `hover:bg-${c}`),

..._options.colors.map(c => `border-${c}`),
..._options.colors.map(c => `text-${c}`),
..._options.colors.map(c => `shadow-${c}`),
..._options.colors.map(c => `after:bg-${c}`),

// Typography
Expand Down

0 comments on commit e75d414

Please sign in to comment.