@pimolu/web-styles 0.1.0-beta.8 → 0.1.0-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.fr.md +125 -125
- package/README.md +6 -6
- package/dist/api-table.css +6 -5
- package/dist/arc-carousel.css +248 -0
- package/dist/carousel.css +5 -1
- package/dist/coverflow-carousel.css +238 -0
- package/dist/layered.css +547 -6
- package/dist/modal.css +186 -0
- package/dist/multi-carousel.css +236 -0
- package/dist/peek-carousel.css +237 -0
- package/dist/pimolu.css +531 -6
- package/dist/pimolu.min.css +1 -1
- package/dist/stack-carousel.css +237 -0
- package/dist/themes.css +129 -0
- package/dist/thumbnail-carousel.css +231 -0
- package/dist/tokens.css +902 -0
- package/package.json +176 -171
package/README.fr.md
CHANGED
|
@@ -1,125 +1,125 @@
|
|
|
1
|
-
# @pimolu/web-styles
|
|
2
|
-
|
|
3
|
-
**Un langage visuel, exprimé en CSS natif.**
|
|
4
|
-
|
|
5
|
-
La couche de style derrière Pimolu UI. Chargez une feuille complète, optez pour des couches CSS prévisibles, ou assemblez uniquement le CSS des composants utilisés. Aucune dépendance à Tailwind, aucun runtime CSS-in-JS.
|
|
6
|
-
|
|
7
|
-
[Démarrage rapide](https://pimolu.com/docs/quick-start) · [Thèmes](https://pimolu.com/docs/theming) · [Personnalisation](https://github.com/pimoludev/ui/blob/main/docs/CUSTOMIZATION.md) · [Source](https://github.com/pimoludev/ui/tree/main/packages/web-styles)
|
|
8
|
-
|
|
9
|
-
> **Bêta :** `0.1.0-beta.
|
|
10
|
-
|
|
11
|
-
## Pourquoi les styles Pimolu ?
|
|
12
|
-
|
|
13
|
-
- **Un import, le système complet.** `styles.css` combine les tokens primitifs, les thèmes sémantiques, les sept presets et chaque feuille de composant.
|
|
14
|
-
- **Des surcharges sans `!important`.** `layered.css` place la bibliothèque dans une couche `pimolu` pour que les règles applicatives et les utilitaires Tailwind gagnent de façon prévisible.
|
|
15
|
-
- **Le CSS par composant quand vous en avez besoin.** Chaque famille possède un sous-chemin CSS exporté : une petite application peut charger seulement les fondations et les contrôles utilisés.
|
|
16
|
-
- **CSS natif, zéro runtime.** Aucun calcul de style en JavaScript et aucun nom de classe généré. Les changements de thème passent par des attributs.
|
|
17
|
-
- **Des versions alignées.** Le CSS et React sont publiés à la même version. Gardez-les ensemble.
|
|
18
|
-
|
|
19
|
-
## En bref
|
|
20
|
-
|
|
21
|
-
| | |
|
|
22
|
-
| --- | --- |
|
|
23
|
-
| Entrées | `styles.css`, `layered.css`, `pimolu.min.css` |
|
|
24
|
-
| Styles de composants | 129 sous-chemins CSS exportés |
|
|
25
|
-
| Fondations | Tokens, thèmes sémantiques, sept presets visuels |
|
|
26
|
-
| Thèmes | Clair et sombre, y compris la préférence système via le Provider |
|
|
27
|
-
| Presets | default, adaptive, cartoon, glass, luxury, monochrome, neo-brutalism |
|
|
28
|
-
| Runtime | Aucun — Tailwind ou CSS-in-JS non requis |
|
|
29
|
-
|
|
30
|
-
## Installation
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
pnpm add @pimolu/web-styles@beta
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
Vous utilisez aussi les composants React ?
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
pnpm add @pimolu/react@beta @pimolu/web-styles@beta
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
## Feuille complète
|
|
43
|
-
|
|
44
|
-
Importez-la une fois au point d'entrée de l'application :
|
|
45
|
-
|
|
46
|
-
```css
|
|
47
|
-
@import "@pimolu/web-styles/styles.css";
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
Définissez ensuite le mode de couleur et le preset sur un conteneur, ou laissez `PimoluProvider` le faire :
|
|
51
|
-
|
|
52
|
-
```html
|
|
53
|
-
<div data-pimolu-theme="dark" data-pimolu-style="glass">
|
|
54
|
-
<!-- Votre application -->
|
|
55
|
-
</div>
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
Une version minifiée est disponible :
|
|
59
|
-
|
|
60
|
-
```css
|
|
61
|
-
@import "@pimolu/web-styles/pimolu.min.css";
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
## Des surcharges prévisibles
|
|
65
|
-
|
|
66
|
-
Utilisez l'entrée en couches quand le CSS applicatif doit surcharger Pimolu sans escalade de spécificité :
|
|
67
|
-
|
|
68
|
-
```css
|
|
69
|
-
@import "@pimolu/web-styles/layered.css";
|
|
70
|
-
|
|
71
|
-
.checkout-action:hover:enabled {
|
|
72
|
-
background: var(--pimolu-success);
|
|
73
|
-
color: var(--pimolu-success-foreground);
|
|
74
|
-
}
|
|
75
|
-
```
|
|
76
|
-
|
|
77
|
-
Importez `styles.css` ou `layered.css`, pas les deux. Avec Tailwind v4, déclarez l'ordre complet des couches avant l'un ou l'autre :
|
|
78
|
-
|
|
79
|
-
```css
|
|
80
|
-
@layer theme, base, pimolu, components, utilities;
|
|
81
|
-
@import "tailwindcss/theme.css" layer(theme);
|
|
82
|
-
@import "@pimolu/web-styles/layered.css";
|
|
83
|
-
@import "tailwindcss/utilities.css" layer(utilities);
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
Le contrat de personnalisation couvre les hooks de panneaux, le scope des portails et les responsabilités d'accessibilité.
|
|
87
|
-
|
|
88
|
-
## Assembler uniquement le nécessaire
|
|
89
|
-
|
|
90
|
-
Installez les fondations et importez le CSS des composants utilisés :
|
|
91
|
-
|
|
92
|
-
```bash
|
|
93
|
-
pnpm add @pimolu/web-styles@beta @pimolu/themes@beta
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
```css
|
|
97
|
-
@import "@pimolu/themes/styles.css";
|
|
98
|
-
@import "@pimolu/themes/presets.css";
|
|
99
|
-
@import "@pimolu/web-styles/button.css";
|
|
100
|
-
@import "@pimolu/web-styles/input.css";
|
|
101
|
-
@import "@pimolu/web-styles/card.css";
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
Chaque famille possède son sous-chemin, de `accordion.css` à `watermark.css`. Gardez les versions CSS et React alignées.
|
|
105
|
-
|
|
106
|
-
## La famille de packages
|
|
107
|
-
|
|
108
|
-
| Package | Rôle |
|
|
109
|
-
| --- | --- |
|
|
110
|
-
| [`@pimolu/react`](https://www.npmjs.com/package/@pimolu/react) | Composants, hooks et layouts React |
|
|
111
|
-
| [`@pimolu/web-styles`](https://www.npmjs.com/package/@pimolu/web-styles) | CSS complet, entrée en couches et CSS par composant |
|
|
112
|
-
| [`@pimolu/themes`](https://www.npmjs.com/package/@pimolu/themes) | Thèmes clair/sombre, sept presets et données visuelles |
|
|
113
|
-
| [`@pimolu/design-tokens`](https://www.npmjs.com/package/@pimolu/design-tokens) | Tokens primitifs en CSS et JSON |
|
|
114
|
-
| [`@pimolu/core`](https://www.npmjs.com/package/@pimolu/core) | Utilitaire de classes de variantes indépendant du framework |
|
|
115
|
-
|
|
116
|
-
## Documentation et état
|
|
117
|
-
|
|
118
|
-
- [Démarrage rapide](https://pimolu.com/docs/quick-start)
|
|
119
|
-
- [Thèmes et presets](https://pimolu.com/docs/theming)
|
|
120
|
-
- [Contrat de personnalisation](https://github.com/pimoludev/ui/blob/main/docs/CUSTOMIZATION.md)
|
|
121
|
-
- [Source et issues](https://github.com/pimoludev/ui)
|
|
122
|
-
|
|
123
|
-
Pimolu UI est en bêta. Le registre React est implémenté ; les registres native, Angular et web components sont des directions futures. La revue visuelle et d'assistance technique complète reste ouverte.
|
|
124
|
-
|
|
125
|
-
MIT © Pimolu
|
|
1
|
+
# @pimolu/web-styles
|
|
2
|
+
|
|
3
|
+
**Un langage visuel, exprimé en CSS natif.**
|
|
4
|
+
|
|
5
|
+
La couche de style derrière Pimolu UI. Chargez une feuille complète, optez pour des couches CSS prévisibles, ou assemblez uniquement le CSS des composants utilisés. Aucune dépendance à Tailwind, aucun runtime CSS-in-JS.
|
|
6
|
+
|
|
7
|
+
[Démarrage rapide](https://pimolu.com/docs/quick-start) · [Thèmes](https://pimolu.com/docs/theming) · [Personnalisation](https://github.com/pimoludev/ui/blob/main/docs/CUSTOMIZATION.md) · [Source](https://github.com/pimoludev/ui/tree/main/packages/web-styles)
|
|
8
|
+
|
|
9
|
+
> **Bêta :** `0.1.0-beta.9` est une prévisualisation. Les entrées CSS publiques et les tokens visuels peuvent évoluer avant `1.0.0`.
|
|
10
|
+
|
|
11
|
+
## Pourquoi les styles Pimolu ?
|
|
12
|
+
|
|
13
|
+
- **Un import, le système complet.** `styles.css` combine les tokens primitifs, les thèmes sémantiques, les sept presets et chaque feuille de composant.
|
|
14
|
+
- **Des surcharges sans `!important`.** `layered.css` place la bibliothèque dans une couche `pimolu` pour que les règles applicatives et les utilitaires Tailwind gagnent de façon prévisible.
|
|
15
|
+
- **Le CSS par composant quand vous en avez besoin.** Chaque famille possède un sous-chemin CSS exporté : une petite application peut charger seulement les fondations et les contrôles utilisés.
|
|
16
|
+
- **CSS natif, zéro runtime.** Aucun calcul de style en JavaScript et aucun nom de classe généré. Les changements de thème passent par des attributs.
|
|
17
|
+
- **Des versions alignées.** Le CSS et React sont publiés à la même version. Gardez-les ensemble.
|
|
18
|
+
|
|
19
|
+
## En bref
|
|
20
|
+
|
|
21
|
+
| | |
|
|
22
|
+
| --- | --- |
|
|
23
|
+
| Entrées | `styles.css`, `layered.css`, `tokens.css`, `themes.css`, `pimolu.min.css` |
|
|
24
|
+
| Styles de composants | 129 sous-chemins CSS exportés |
|
|
25
|
+
| Fondations | Tokens, thèmes sémantiques, sept presets visuels |
|
|
26
|
+
| Thèmes | Clair et sombre, y compris la préférence système via le Provider |
|
|
27
|
+
| Presets | default, adaptive, cartoon, glass, luxury, monochrome, neo-brutalism |
|
|
28
|
+
| Runtime | Aucun — Tailwind ou CSS-in-JS non requis |
|
|
29
|
+
|
|
30
|
+
## Installation
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
pnpm add @pimolu/web-styles@beta
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Vous utilisez aussi les composants React ?
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
pnpm add @pimolu/react@beta @pimolu/web-styles@beta
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Feuille complète
|
|
43
|
+
|
|
44
|
+
Importez-la une fois au point d'entrée de l'application :
|
|
45
|
+
|
|
46
|
+
```css
|
|
47
|
+
@import "@pimolu/web-styles/styles.css";
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Définissez ensuite le mode de couleur et le preset sur un conteneur, ou laissez `PimoluProvider` le faire :
|
|
51
|
+
|
|
52
|
+
```html
|
|
53
|
+
<div data-pimolu-theme="dark" data-pimolu-style="glass">
|
|
54
|
+
<!-- Votre application -->
|
|
55
|
+
</div>
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Une version minifiée est disponible :
|
|
59
|
+
|
|
60
|
+
```css
|
|
61
|
+
@import "@pimolu/web-styles/pimolu.min.css";
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Des surcharges prévisibles
|
|
65
|
+
|
|
66
|
+
Utilisez l'entrée en couches quand le CSS applicatif doit surcharger Pimolu sans escalade de spécificité :
|
|
67
|
+
|
|
68
|
+
```css
|
|
69
|
+
@import "@pimolu/web-styles/layered.css";
|
|
70
|
+
|
|
71
|
+
.checkout-action:hover:enabled {
|
|
72
|
+
background: var(--pimolu-success);
|
|
73
|
+
color: var(--pimolu-success-foreground);
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Importez `styles.css` ou `layered.css`, pas les deux. Avec Tailwind v4, déclarez l'ordre complet des couches avant l'un ou l'autre :
|
|
78
|
+
|
|
79
|
+
```css
|
|
80
|
+
@layer theme, base, pimolu, components, utilities;
|
|
81
|
+
@import "tailwindcss/theme.css" layer(theme);
|
|
82
|
+
@import "@pimolu/web-styles/layered.css";
|
|
83
|
+
@import "tailwindcss/utilities.css" layer(utilities);
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Le contrat de personnalisation couvre les hooks de panneaux, le scope des portails et les responsabilités d'accessibilité.
|
|
87
|
+
|
|
88
|
+
## Assembler uniquement le nécessaire
|
|
89
|
+
|
|
90
|
+
Installez les fondations et importez le CSS des composants utilisés :
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
pnpm add @pimolu/web-styles@beta @pimolu/themes@beta
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
```css
|
|
97
|
+
@import "@pimolu/themes/styles.css";
|
|
98
|
+
@import "@pimolu/themes/presets.css";
|
|
99
|
+
@import "@pimolu/web-styles/button.css";
|
|
100
|
+
@import "@pimolu/web-styles/input.css";
|
|
101
|
+
@import "@pimolu/web-styles/card.css";
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Chaque famille possède son sous-chemin, de `accordion.css` à `watermark.css`. Gardez les versions CSS et React alignées.
|
|
105
|
+
|
|
106
|
+
## La famille de packages
|
|
107
|
+
|
|
108
|
+
| Package | Rôle |
|
|
109
|
+
| --- | --- |
|
|
110
|
+
| [`@pimolu/react`](https://www.npmjs.com/package/@pimolu/react) | Composants, hooks et layouts React |
|
|
111
|
+
| [`@pimolu/web-styles`](https://www.npmjs.com/package/@pimolu/web-styles) | CSS complet, entrée en couches et CSS par composant |
|
|
112
|
+
| [`@pimolu/themes`](https://www.npmjs.com/package/@pimolu/themes) | Thèmes clair/sombre, sept presets et données visuelles |
|
|
113
|
+
| [`@pimolu/design-tokens`](https://www.npmjs.com/package/@pimolu/design-tokens) | Tokens primitifs en CSS et JSON |
|
|
114
|
+
| [`@pimolu/core`](https://www.npmjs.com/package/@pimolu/core) | Utilitaire de classes de variantes indépendant du framework |
|
|
115
|
+
|
|
116
|
+
## Documentation et état
|
|
117
|
+
|
|
118
|
+
- [Démarrage rapide](https://pimolu.com/docs/quick-start)
|
|
119
|
+
- [Thèmes et presets](https://pimolu.com/docs/theming)
|
|
120
|
+
- [Contrat de personnalisation](https://github.com/pimoludev/ui/blob/main/docs/CUSTOMIZATION.md)
|
|
121
|
+
- [Source et issues](https://github.com/pimoludev/ui)
|
|
122
|
+
|
|
123
|
+
Pimolu UI est en bêta. Le registre React est implémenté ; les registres native, Angular et web components sont des directions futures. La revue visuelle et d'assistance technique complète reste ouverte.
|
|
124
|
+
|
|
125
|
+
MIT © Pimolu
|
package/README.md
CHANGED
|
@@ -6,13 +6,13 @@ The styling layer behind Pimolu UI. Load one complete stylesheet, opt into predi
|
|
|
6
6
|
|
|
7
7
|
[Quick start](https://pimolu.com/docs/quick-start) · [Theming](https://pimolu.com/docs/theming) · [Customization](https://github.com/pimoludev/ui/blob/main/docs/CUSTOMIZATION.md) · [Source](https://github.com/pimoludev/ui/tree/main/packages/web-styles)
|
|
8
8
|
|
|
9
|
-
> **Beta:** `0.1.0-beta.
|
|
9
|
+
> **Beta:** `0.1.0-beta.9` is a preview. Public CSS entry points and visual tokens may change before `1.0.0`.
|
|
10
10
|
|
|
11
11
|
## Why Pimolu styles?
|
|
12
12
|
|
|
13
13
|
- **One import, the complete system.** `styles.css` combines primitive tokens, semantic themes, all seven presets and every component stylesheet.
|
|
14
14
|
- **Overrides without `!important`.** `layered.css` places the library in a `pimolu` cascade layer so normal application rules and Tailwind utilities can win predictably.
|
|
15
|
-
- **Component-level CSS when you need it.** Every family has an exported CSS subpath, so a small application can load only the foundations and controls it uses.
|
|
15
|
+
- **Component-level CSS when you need it.** Every family has an exported CSS subpath, so a small application can load only the foundations and controls it uses. `tokens.css` provides every custom property and `themes.css` the light/dark semantic themes, both without component rules. okens.css provides every custom property and hemes.css the light/dark semantic themes, both without component rules.
|
|
16
16
|
- **Plain CSS, zero runtime.** No style calculations in JavaScript and no generated class names. Theme changes are attribute-driven.
|
|
17
17
|
- **Aligned releases.** The CSS and React packages ship at the same version. Keep them together.
|
|
18
18
|
|
|
@@ -20,7 +20,7 @@ The styling layer behind Pimolu UI. Load one complete stylesheet, opt into predi
|
|
|
20
20
|
|
|
21
21
|
| | |
|
|
22
22
|
| --- | --- |
|
|
23
|
-
| Entries | `styles.css`, `layered.css`, `pimolu.min.css` |
|
|
23
|
+
| Entries | `styles.css`, `layered.css`, `tokens.css`, `themes.css`, `pimolu.min.css` |
|
|
24
24
|
| Component styles | 129 exported CSS subpaths |
|
|
25
25
|
| Foundations | Tokens, semantic themes, seven visual presets |
|
|
26
26
|
| Themes | Light and dark, including system preference through the Provider |
|
|
@@ -30,13 +30,13 @@ The styling layer behind Pimolu UI. Load one complete stylesheet, opt into predi
|
|
|
30
30
|
## Install
|
|
31
31
|
|
|
32
32
|
```bash
|
|
33
|
-
pnpm add @pimolu/web-styles@
|
|
33
|
+
pnpm add @pimolu/web-styles@latest
|
|
34
34
|
```
|
|
35
35
|
|
|
36
36
|
Using React components as well?
|
|
37
37
|
|
|
38
38
|
```bash
|
|
39
|
-
pnpm add @pimolu/react@
|
|
39
|
+
pnpm add @pimolu/react@latest @pimolu/web-styles@latest
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
## Complete stylesheet
|
|
@@ -90,7 +90,7 @@ The customization contract covers panel hooks, portal scope and accessibility re
|
|
|
90
90
|
Install the foundations package and import the component CSS you need:
|
|
91
91
|
|
|
92
92
|
```bash
|
|
93
|
-
pnpm add @pimolu/web-styles@
|
|
93
|
+
pnpm add @pimolu/web-styles@latest @pimolu/themes@latest
|
|
94
94
|
```
|
|
95
95
|
|
|
96
96
|
```css
|
package/dist/api-table.css
CHANGED
|
@@ -29,19 +29,20 @@
|
|
|
29
29
|
border-radius: var(--pimolu-radius-sm, 6px);
|
|
30
30
|
}
|
|
31
31
|
.pimolu-api-table__table.pimolu-table {
|
|
32
|
-
min-width:
|
|
32
|
+
min-width: 0;
|
|
33
|
+
table-layout: fixed;
|
|
33
34
|
}
|
|
34
35
|
.pimolu-api-table__table :where(th, td):nth-child(1) {
|
|
35
|
-
width:
|
|
36
|
+
width: 20%;
|
|
36
37
|
}
|
|
37
38
|
.pimolu-api-table__table :where(th, td):nth-child(2) {
|
|
38
|
-
width:
|
|
39
|
+
width: 36%;
|
|
39
40
|
}
|
|
40
41
|
.pimolu-api-table__table :where(th, td):nth-child(3) {
|
|
41
|
-
width:
|
|
42
|
+
width: 10%;
|
|
42
43
|
}
|
|
43
44
|
.pimolu-api-table__table :where(th, td):nth-child(4) {
|
|
44
|
-
width:
|
|
45
|
+
width: 34%;
|
|
45
46
|
}
|
|
46
47
|
.pimolu-api-table__name {
|
|
47
48
|
display: flex;
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
/* src/carousel-base.css */
|
|
2
|
+
.pimolu-carousel-root {
|
|
3
|
+
position: relative;
|
|
4
|
+
display: grid;
|
|
5
|
+
gap: 12px;
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
min-width: 0;
|
|
8
|
+
max-width: 100%;
|
|
9
|
+
color: var(--pimolu-foreground);
|
|
10
|
+
font-family: var(--pimolu-font-body, inherit);
|
|
11
|
+
--pimolu-carousel-gap: 16px;
|
|
12
|
+
--pimolu-carousel-per-view: 1;
|
|
13
|
+
}
|
|
14
|
+
.pimolu-carousel-root > .pimolu-carousel__viewport {
|
|
15
|
+
display: block;
|
|
16
|
+
overflow: visible;
|
|
17
|
+
border-radius: 0;
|
|
18
|
+
scroll-snap-type: none;
|
|
19
|
+
}
|
|
20
|
+
.pimolu-carousel-root > .pimolu-carousel__viewport[data-scroll=false] {
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
}
|
|
23
|
+
.pimolu-carousel__viewport {
|
|
24
|
+
position: relative;
|
|
25
|
+
box-sizing: border-box;
|
|
26
|
+
min-width: 0;
|
|
27
|
+
outline: none;
|
|
28
|
+
}
|
|
29
|
+
.pimolu-carousel__viewport:focus-visible {
|
|
30
|
+
outline: 2px solid var(--pimolu-focus-ring, currentColor);
|
|
31
|
+
outline-offset: 3px;
|
|
32
|
+
}
|
|
33
|
+
.pimolu-carousel__viewport[data-scroll=true] {
|
|
34
|
+
display: flex;
|
|
35
|
+
gap: var(--pimolu-carousel-gap, 16px);
|
|
36
|
+
overflow-x: auto;
|
|
37
|
+
overflow-y: hidden;
|
|
38
|
+
overscroll-behavior-x: contain;
|
|
39
|
+
scroll-behavior: smooth;
|
|
40
|
+
scroll-snap-type: x mandatory;
|
|
41
|
+
scrollbar-width: none;
|
|
42
|
+
}
|
|
43
|
+
.pimolu-carousel__viewport[data-scroll=true]::-webkit-scrollbar {
|
|
44
|
+
display: none;
|
|
45
|
+
}
|
|
46
|
+
.pimolu-carousel__slide {
|
|
47
|
+
box-sizing: border-box;
|
|
48
|
+
min-width: 0;
|
|
49
|
+
transition: transform 480ms cubic-bezier(0.22, 1, 0.36, 1), opacity 480ms ease;
|
|
50
|
+
}
|
|
51
|
+
.pimolu-carousel__viewport[data-scroll=true] .pimolu-carousel__slide {
|
|
52
|
+
flex: 1 0 calc((100% - (var(--pimolu-carousel-per-view, 1) - 1) * var(--pimolu-carousel-gap, 16px)) / var(--pimolu-carousel-per-view, 1));
|
|
53
|
+
scroll-snap-align: start;
|
|
54
|
+
}
|
|
55
|
+
.pimolu-carousel__viewport[data-effect=peek] .pimolu-carousel__slide {
|
|
56
|
+
flex: 0 0 min(440px, 68vw);
|
|
57
|
+
scroll-snap-align: center;
|
|
58
|
+
}
|
|
59
|
+
.pimolu-carousel__control {
|
|
60
|
+
position: absolute;
|
|
61
|
+
top: 50%;
|
|
62
|
+
z-index: 20;
|
|
63
|
+
display: inline-flex;
|
|
64
|
+
align-items: center;
|
|
65
|
+
justify-content: center;
|
|
66
|
+
box-sizing: border-box;
|
|
67
|
+
width: 2.5rem;
|
|
68
|
+
height: 2.5rem;
|
|
69
|
+
padding: 0;
|
|
70
|
+
border: 1px solid var(--pimolu-border, currentColor);
|
|
71
|
+
border-radius: var(--pimolu-radius-full, 999px);
|
|
72
|
+
background: var(--pimolu-background, Canvas);
|
|
73
|
+
color: var(--pimolu-foreground);
|
|
74
|
+
box-shadow: var(--pimolu-shadow-raised, 0 2px 8px rgb(0 0 0 / 18%));
|
|
75
|
+
cursor: pointer;
|
|
76
|
+
transform: translateY(-50%);
|
|
77
|
+
transition: background-color 150ms, opacity 150ms;
|
|
78
|
+
}
|
|
79
|
+
.pimolu-carousel__control--previous {
|
|
80
|
+
inset-inline-start: var(--pimolu-spacing-2, 8px);
|
|
81
|
+
}
|
|
82
|
+
.pimolu-carousel__control--next {
|
|
83
|
+
inset-inline-end: var(--pimolu-spacing-2, 8px);
|
|
84
|
+
}
|
|
85
|
+
.pimolu-carousel__control:hover:not(:disabled) {
|
|
86
|
+
background: var(--pimolu-muted, var(--pimolu-background, Canvas));
|
|
87
|
+
}
|
|
88
|
+
.pimolu-carousel__control:disabled {
|
|
89
|
+
opacity: 0.35;
|
|
90
|
+
cursor: default;
|
|
91
|
+
}
|
|
92
|
+
.pimolu-carousel__control:focus-visible {
|
|
93
|
+
outline: 2px solid var(--pimolu-focus-ring, currentColor);
|
|
94
|
+
outline-offset: 2px;
|
|
95
|
+
}
|
|
96
|
+
.pimolu-carousel__control svg {
|
|
97
|
+
display: block;
|
|
98
|
+
width: 1.25rem;
|
|
99
|
+
height: 1.25rem;
|
|
100
|
+
}
|
|
101
|
+
.pimolu-carousel__dots {
|
|
102
|
+
display: flex;
|
|
103
|
+
flex-wrap: wrap;
|
|
104
|
+
align-items: center;
|
|
105
|
+
justify-content: center;
|
|
106
|
+
gap: 2px;
|
|
107
|
+
min-width: 0;
|
|
108
|
+
}
|
|
109
|
+
.pimolu-carousel__dot {
|
|
110
|
+
display: inline-grid;
|
|
111
|
+
place-items: center;
|
|
112
|
+
box-sizing: border-box;
|
|
113
|
+
width: 1.5rem;
|
|
114
|
+
height: 1.5rem;
|
|
115
|
+
padding: 0;
|
|
116
|
+
border: 0;
|
|
117
|
+
border-radius: var(--pimolu-radius-full, 999px);
|
|
118
|
+
background: transparent;
|
|
119
|
+
cursor: pointer;
|
|
120
|
+
}
|
|
121
|
+
.pimolu-carousel__dot::before {
|
|
122
|
+
content: "";
|
|
123
|
+
display: block;
|
|
124
|
+
width: 0.5rem;
|
|
125
|
+
height: 0.5rem;
|
|
126
|
+
border-radius: var(--pimolu-radius-full, 999px);
|
|
127
|
+
background: color-mix(in srgb, var(--pimolu-foreground, currentColor) 28%, transparent);
|
|
128
|
+
transition: width 150ms, background-color 150ms;
|
|
129
|
+
}
|
|
130
|
+
.pimolu-carousel__dot[data-active=true]::before {
|
|
131
|
+
width: 1.25rem;
|
|
132
|
+
background: var(--pimolu-primary, var(--pimolu-foreground, currentColor));
|
|
133
|
+
}
|
|
134
|
+
.pimolu-carousel__dot:focus-visible {
|
|
135
|
+
outline: 2px solid var(--pimolu-focus-ring, currentColor);
|
|
136
|
+
outline-offset: 2px;
|
|
137
|
+
}
|
|
138
|
+
.pimolu-carousel__thumbnails {
|
|
139
|
+
display: flex;
|
|
140
|
+
gap: 8px;
|
|
141
|
+
min-width: 0;
|
|
142
|
+
overflow-x: auto;
|
|
143
|
+
scrollbar-width: none;
|
|
144
|
+
}
|
|
145
|
+
.pimolu-carousel__thumbnails::-webkit-scrollbar {
|
|
146
|
+
display: none;
|
|
147
|
+
}
|
|
148
|
+
.pimolu-carousel__thumbnail {
|
|
149
|
+
flex: 0 0 auto;
|
|
150
|
+
box-sizing: border-box;
|
|
151
|
+
width: 72px;
|
|
152
|
+
padding: 2px;
|
|
153
|
+
border: 2px solid transparent;
|
|
154
|
+
border-radius: calc(var(--pimolu-radius-sm, 6px) + 4px);
|
|
155
|
+
background: transparent;
|
|
156
|
+
cursor: pointer;
|
|
157
|
+
opacity: 0.6;
|
|
158
|
+
transition: opacity 150ms, border-color 150ms;
|
|
159
|
+
}
|
|
160
|
+
.pimolu-carousel__thumbnail img {
|
|
161
|
+
display: block;
|
|
162
|
+
width: 100%;
|
|
163
|
+
height: auto;
|
|
164
|
+
border-radius: var(--pimolu-radius-sm, 6px);
|
|
165
|
+
object-fit: cover;
|
|
166
|
+
}
|
|
167
|
+
.pimolu-carousel__thumbnail[data-active=true] {
|
|
168
|
+
border-color: var(--pimolu-primary);
|
|
169
|
+
opacity: 1;
|
|
170
|
+
}
|
|
171
|
+
.pimolu-carousel__thumbnail:hover {
|
|
172
|
+
opacity: 1;
|
|
173
|
+
}
|
|
174
|
+
.pimolu-carousel__thumbnail:focus-visible {
|
|
175
|
+
outline: 2px solid var(--pimolu-focus-ring, currentColor);
|
|
176
|
+
outline-offset: 2px;
|
|
177
|
+
}
|
|
178
|
+
.pimolu-carousel__live {
|
|
179
|
+
position: absolute;
|
|
180
|
+
width: 1px;
|
|
181
|
+
height: 1px;
|
|
182
|
+
margin: -1px;
|
|
183
|
+
padding: 0;
|
|
184
|
+
overflow: hidden;
|
|
185
|
+
clip: rect(0 0 0 0);
|
|
186
|
+
white-space: nowrap;
|
|
187
|
+
border: 0;
|
|
188
|
+
}
|
|
189
|
+
@media (prefers-reduced-motion: reduce) {
|
|
190
|
+
.pimolu-carousel__viewport[data-scroll=true] {
|
|
191
|
+
scroll-behavior: auto;
|
|
192
|
+
}
|
|
193
|
+
.pimolu-carousel__slide,
|
|
194
|
+
.pimolu-carousel__control,
|
|
195
|
+
.pimolu-carousel__dot::before,
|
|
196
|
+
.pimolu-carousel__thumbnail {
|
|
197
|
+
transition: none;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
@media (forced-colors: active) {
|
|
201
|
+
.pimolu-carousel__control {
|
|
202
|
+
border-color: CanvasText;
|
|
203
|
+
background: Canvas;
|
|
204
|
+
color: CanvasText;
|
|
205
|
+
box-shadow: none;
|
|
206
|
+
}
|
|
207
|
+
.pimolu-carousel__dot::before {
|
|
208
|
+
background: CanvasText;
|
|
209
|
+
}
|
|
210
|
+
.pimolu-carousel__dot[data-active=true]::before {
|
|
211
|
+
background: Highlight;
|
|
212
|
+
}
|
|
213
|
+
.pimolu-carousel__thumbnail {
|
|
214
|
+
border-color: CanvasText;
|
|
215
|
+
}
|
|
216
|
+
.pimolu-carousel__thumbnail[data-active=true] {
|
|
217
|
+
border-color: Highlight;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/* src/arc-carousel.css */
|
|
222
|
+
.pimolu-arc-carousel .pimolu-carousel__viewport {
|
|
223
|
+
height: clamp(260px, 44vw, 400px);
|
|
224
|
+
}
|
|
225
|
+
.pimolu-arc-carousel .pimolu-carousel__slide {
|
|
226
|
+
position: absolute;
|
|
227
|
+
inset-block-end: 0;
|
|
228
|
+
inset-inline-start: 50%;
|
|
229
|
+
width: min(42%, 340px);
|
|
230
|
+
height: 82%;
|
|
231
|
+
margin-inline-start: calc(min(42%, 340px) / -2);
|
|
232
|
+
border-radius: calc(var(--pimolu-radius-lg, 14px) + 2px);
|
|
233
|
+
border: 1px solid var(--pimolu-border);
|
|
234
|
+
background: var(--pimolu-surface);
|
|
235
|
+
overflow: hidden;
|
|
236
|
+
transform-origin: center bottom;
|
|
237
|
+
}
|
|
238
|
+
@media (max-width: 640px) {
|
|
239
|
+
.pimolu-arc-carousel .pimolu-carousel__slide {
|
|
240
|
+
display: none;
|
|
241
|
+
width: min(60%, 340px);
|
|
242
|
+
margin-inline-start: calc(min(60%, 340px) / -2);
|
|
243
|
+
}
|
|
244
|
+
.pimolu-arc-carousel .pimolu-carousel__slide[data-active=true],
|
|
245
|
+
.pimolu-arc-carousel .pimolu-carousel__slide[data-distance="1"] {
|
|
246
|
+
display: block;
|
|
247
|
+
}
|
|
248
|
+
}
|
package/dist/carousel.css
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
box-sizing: border-box;
|
|
7
7
|
min-width: 0;
|
|
8
8
|
max-width: 100%;
|
|
9
|
+
--pimolu-carousel-control-reserve: 56px;
|
|
9
10
|
color: var(--pimolu-foreground);
|
|
10
11
|
font-family: var(--pimolu-font-body, inherit);
|
|
11
12
|
}
|
|
@@ -38,7 +39,7 @@
|
|
|
38
39
|
scroll-snap-stop: always;
|
|
39
40
|
}
|
|
40
41
|
.pimolu-carousel[data-controls=true] .pimolu-carousel__slide {
|
|
41
|
-
padding-inline: 56px;
|
|
42
|
+
padding-inline: var(--pimolu-carousel-control-reserve, 56px);
|
|
42
43
|
}
|
|
43
44
|
.pimolu-carousel__control {
|
|
44
45
|
position: absolute;
|
|
@@ -177,6 +178,9 @@
|
|
|
177
178
|
height: 0.875rem;
|
|
178
179
|
}
|
|
179
180
|
@media (max-width: 600px) {
|
|
181
|
+
.pimolu-carousel {
|
|
182
|
+
--pimolu-carousel-control-reserve: 44px;
|
|
183
|
+
}
|
|
180
184
|
.pimolu-carousel__control {
|
|
181
185
|
width: 2rem;
|
|
182
186
|
height: 2rem;
|