-
Notifications
You must be signed in to change notification settings - Fork 342
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: setup unocss integration page * feat: add unocss config example * feat: add description and translations * refactor: rewrite to js * refactor: rewrite key to lowercase * feat: configure unocss integration page * refactor: remove redundant preset from example * feat: split translations * refactor: added empty line
- Loading branch information
1 parent
51fb6a6
commit 3fb55c8
Showing
7 changed files
with
83 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
packages/docs/page-config/extensions/unocss/code/unocss.config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// unocss.config.* | ||
import { defineConfig, presetUno } from 'unocss' | ||
import presetTheme from 'unocss-preset-theme' | ||
import { colorsPreset, thresholdsPreset } from 'vuestic-ui' | ||
|
||
const convertNumbersToCssUnits = (obj, unit = 'px') => | ||
Object.entries(obj).reduce((acc, [key, value]) => ({ | ||
...acc, | ||
[key]: `${value}${unit}`, | ||
}), {}) | ||
|
||
export default defineConfig({ | ||
theme: { | ||
colors: colorsPreset.light, | ||
breakpoints: convertNumbersToCssUnits(thresholdsPreset), | ||
}, | ||
presets: [ | ||
presetUno({ | ||
dark: 'media', | ||
}), | ||
presetTheme({ | ||
theme: { | ||
dark: { | ||
colors: colorsPreset.dark, | ||
}, | ||
}, | ||
}), | ||
], | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export default definePageConfig({ | ||
blocks: [ | ||
block.title('unocss.title'), | ||
block.paragraph('unocss.text'), | ||
|
||
block.headline('unocss.preparation.title'), | ||
block.paragraph('unocss.preparation.text0'), | ||
block.paragraph('unocss.preparation.text1'), | ||
block.code({ | ||
npm: 'npm i -D unocss-preset-theme', | ||
yarn: 'yarn add -D unocss-preset-theme', | ||
}, 'bash'), | ||
|
||
block.headline('unocss.setup.title'), | ||
block.paragraph('unocss.setup.text'), | ||
block.code('unocss.config.js'), | ||
] | ||
}) |
13 changes: 13 additions & 0 deletions
13
packages/docs/page-config/extensions/unocss/translation/en.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"title": "Integration with UnoCSS", | ||
"text": "Here is guide how to integrate Vuestic UI colors and breakpoints into UnoCSS configuration.", | ||
"preparation": { | ||
"title": "Preparations", | ||
"text0": "Before we start with integration, please ensure you have both UnoCSS and Vuestic UI installed. If that's not the case - here are installation guide for the [Vuestic UI](/getting-started/installation) and for the [UnoCSS]((https://github.com/unocss/unocss#installation))[[target=_blank]].", | ||
"text1": "Also you need to install `unocss-preset-theme` preset." | ||
}, | ||
"setup": { | ||
"title": "Setup", | ||
"text": "Configure configuration file for the UnoCSS as shown below." | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
packages/docs/page-config/extensions/unocss/translation/ru.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"title": "Интеграция с UnoCSS", | ||
"text": "На этой странице представлено описание интеграции цветов и брейкпоинтов Vuestic UI в файл конфигурации UnoCSS.", | ||
"preparation": { | ||
"title": "Подготовка", | ||
"text0": "Прежде чем начать интеграцию, пожалуйста, убедитесь что вы установили и UnoCSS, и Vuestic UI. Если же нет, то вот инструкция по установке для [Vuestic UI](/getting-started/installation) и [UnoCSS]((https://github.com/unocss/unocss#installation))[[target=_blank]].", | ||
"text1": "Также вам нужно установить пресет `unocss-preset-theme`." | ||
}, | ||
"setup": { | ||
"title": "Настройка", | ||
"text": "Настройте файл конфигурации UnoCSS как ниже." | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters