Skip to content

Commit 183e27d

Browse files
committed
feat: logos
1 parent fd046b6 commit 183e27d

6 files changed

Lines changed: 83 additions & 1 deletion

File tree

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -389,6 +389,33 @@ With this, we could have `m-2` applied only when users hover over the element.
389389

390390
The variant system is very powerful and can't be covered fully in this guide, you can check [the default preset's implementation](https://github.com/antfu/unocss/tree/main/packages/preset-uno/src/variants) to see more advanced usages.
391391

392+
### Extend Theme
393+
394+
UnoCSS also supports the theming system that you might be familiar with in Tailwind / Windi. At the user level, you can specify the `theme` property in your config and it will be deep merged to the default theme.
395+
396+
```ts
397+
theme: {
398+
colors: {
399+
'very-cool': '#0000ff',
400+
},
401+
breakpoints: {
402+
xs: '320px',
403+
sm: '640px',
404+
}
405+
}
406+
```
407+
408+
To consume the theme in rules:
409+
410+
```ts
411+
rules: [
412+
[/^text-(.*)$/, ([, c], { theme }) => {
413+
if (theme.colors[c])
414+
return { color: theme.colors[c] }
415+
}]
416+
]
417+
```
418+
392419
### Layers
393420

394421
The orders of CSS will affect their priorities. While we will [retain the order of rules](#ordering), sometimes you may want to group some utilities to have more explicit control of their orders.

packages/inspector/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<title>UnoCSS Inspector</title>
7+
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
78
<link rel="preconnect" href="https://fonts.googleapis.com" />
89
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
910
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@100;200;400&family=Fira+Code&display=swap" rel="stylesheet" />
Lines changed: 21 additions & 0 deletions
Loading

playground/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
<head>
44
<meta charset="UTF-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6-
<title>unocss</title>
6+
<title>UnoCSS Playground</title>
7+
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
78
<link rel="preconnect" href="https://fonts.googleapis.com" />
89
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
910
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@100;200;400&family=Fira+Code&display=swap" rel="stylesheet" />

playground/public/favicon.svg

Lines changed: 21 additions & 0 deletions
Loading

playground/public/icon.svg

Lines changed: 11 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)