mirror of
https://github.com/gromlab-ru/svg-sprites.git
synced 2026-07-22 04:40:17 +03:00
feat: добавить поддержку 20 framework exact modes
Добавлены exact modes: - vue@vite и vue@webpack - nuxt@vite и nuxt@webpack - svelte@vite, svelte@webpack и sveltekit@vite - angular@application и angular@webpack - astro@vite - solid@vite, solid@webpack и solid-start@vite - preact@vite и preact@webpack - qwik@vite - lit@vite и lit@webpack - alpine@vite и alpine@webpack Для каждого mode реализованы изолированный adapter, нативный framework-компонент, declarations, manifest, CSS и внешний asset URL. Добавлены production integration-стенды с генерацией, typecheck, сборкой и Playwright-проверкой рендера спрайта и Viewer. Обновлены Viewer, RU/EN-гайды, README, technical reference и AI skills. Итоговая матрица включает 29 exact modes. Проверки: - 48 unit-тестов - 29 integration E2E-тестов
This commit is contained in:
@@ -4,9 +4,9 @@ A quick guide to creating an SVG sprite in a Webpack 5 application without a fra
|
||||
|
||||
## Generate the sprite
|
||||
|
||||
Choose a folder for the sprite. This example uses `assets/app-icons`, with source SVG files, including the `check.svg` used below, in `assets/svg-icons`.
|
||||
Choose a directory for the future SVG sprite, for example `assets/app-icons`, and create `svg-sprite.config.json` inside it. In `input`, specify the path to existing SVG files relative to the configuration file. There is no need to move or copy the icons.
|
||||
|
||||
Create `assets/app-icons/svg-sprite.config.json`:
|
||||
Example configuration:
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -16,7 +16,7 @@ Create `assets/app-icons/svg-sprite.config.json`:
|
||||
}
|
||||
```
|
||||
|
||||
The `input` path is relative to the config folder.
|
||||
The package does not need to be a project dependency: generation runs through `npx`.
|
||||
|
||||
Add generation commands to `package.json`. Generated files are excluded from Git by default, so `predev` and `prebuild` rebuild the sprite before every start and build:
|
||||
|
||||
@@ -54,10 +54,10 @@ defineAppIconElement()
|
||||
Use the icon in HTML:
|
||||
|
||||
```html
|
||||
<app-icon icon="check" role="img" aria-label="Done"></app-icon>
|
||||
<app-icon icon="icon-name" role="img" aria-label="Done"></app-icon>
|
||||
```
|
||||
|
||||
The file `check.svg` is available as `icon="check"`. Set its size and colors with CSS:
|
||||
The `icon` value is the source SVG filename without the extension. Set its size and colors with CSS:
|
||||
|
||||
```css
|
||||
app-icon {
|
||||
|
||||
Reference in New Issue
Block a user