Skip to content

Commit 661e74a

Browse files
authored
Merge pull request #111 from incluud/next
Next
2 parents ff33f29 + 862bca5 commit 661e74a

File tree

9 files changed

+56
-46
lines changed

9 files changed

+56
-46
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ import { Accordion, AccordionItem } from 'accessible-astro-components'
8181
- [Accessible Astro Components](https://github.com/incluud/accessible-astro-components/): Library of reusable, accessible components build for Astro.
8282
- [Accessible Astro Dashboard](https://github.com/incluud/accessible-astro-dashboard/): User-friendly dashboard interface with a login screen and widgets.
8383
- [Accessible Astro Docs](https://github.com/incluud/accessible-astro-docs): Comprehensive documentation for all Accessible Astro projects.
84+
- [Color Contrast Checker](https://github.com/incluud/color-contrast-checker): WCAG-compliant color contrast checker with design system token generation.
8485

8586
Check out our [roadmap](https://github.com/orgs/incluud/projects/4) to see what's coming next!
8687

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "accessible-astro-components",
33
"description": "A set of Accessible, easy to use, Front-end UI Components for Astro.",
4-
"version": "4.1.1",
4+
"version": "4.1.2",
55
"author": "Incluud",
66
"license": "MIT",
77
"homepage": "https://accessible-astro.incluud.dev/components/overview/",

src/components/accordion/AccordionItem.astro

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,10 @@ const Tag = tagName
212212
}
213213
}
214214

215+
:where(.icon-chevron) {
216+
flex-shrink: 0;
217+
}
218+
215219
:where(.icon-chevron svg) {
216220
@media (prefers-reduced-motion: no-preference) {
217221
transition: transform var(--transition-duration) var(--transition-easing);

src/components/avatar/Avatar.astro

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -166,13 +166,13 @@ const sizeValue = getSizeValue(size)
166166
display: inline-flex;
167167
align-items: center;
168168
gap: 0.75rem;
169+
}
169170

170-
&:has(.initials-container):not(:has(.content)),
171-
&:has(.icon-container):not(:has(.content)) {
172-
aspect-ratio: 1;
173-
inline-size: var(--size);
174-
block-size: var(--size);
175-
}
171+
:where(.avatar:has(.initials-container):not(:has(.content))),
172+
:where(.avatar:has(.icon-container):not(:has(.content))) {
173+
aspect-ratio: 1;
174+
inline-size: var(--size);
175+
block-size: var(--size);
176176
}
177177

178178
:where(.initials-container),
@@ -187,20 +187,16 @@ const sizeValue = getSizeValue(size)
187187
}
188188

189189
/* Shape styles */
190-
.shape-round {
191-
.initials-container,
192-
.icon-container,
193-
.image {
194-
border-radius: 50%;
195-
}
190+
:where(.avatar.shape-round .initials-container),
191+
:where(.avatar.shape-round .icon-container),
192+
:where(.avatar.shape-round .image) {
193+
border-radius: 50%;
196194
}
197195

198-
.shape-square {
199-
.initials-container,
200-
.icon-container,
201-
.image {
202-
border-radius: 0.25rem;
203-
}
196+
:where(.avatar.shape-square .initials-container),
197+
:where(.avatar.shape-square .icon-container),
198+
:where(.avatar.shape-square .image) {
199+
border-radius: 0.25rem;
204200
}
205201

206202
/* Default type */

src/components/badge/Badge.astro

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ const sizeClass = `size-${size}`
152152

153153
display: inline-flex;
154154
position: relative;
155+
justify-content: center;
155156
align-items: center;
156157
border: 2px solid;
157158
border-radius: 0.5rem;
@@ -237,8 +238,6 @@ const sizeClass = `size-${size}`
237238

238239
/* Circular badge styles */
239240
:where(.circular) {
240-
justify-content: center;
241-
align-items: center;
242241
border-radius: 50%;
243242
padding: 0;
244243
aspect-ratio: 1 / 1;

src/components/card/Card.astro

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,10 @@ const Tag = tagName
144144
inline-size: 100%;
145145
block-size: 100%;
146146
object-fit: cover;
147+
}
147148

148-
@media (prefers-reduced-motion: no-preference) {
149+
@media (prefers-reduced-motion: no-preference) {
150+
:where(.image img) {
149151
transition: transform var(--transition-duration) var(--transition-easing);
150152
}
151153
}

src/components/modal/Modal.astro

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,10 @@ const {
242242
opacity: 0;
243243
backdrop-filter: blur(5px);
244244
background-color: rgba(0 0 0 / 0.5);
245+
}
245246

246-
@media (prefers-reduced-motion: no-preference) {
247+
@media (prefers-reduced-motion: no-preference) {
248+
.modal::backdrop {
247249
transition-behavior: allow-discrete;
248250
transition-duration: 0.3s;
249251
transition-property: display, opacity, overlay;
@@ -278,8 +280,10 @@ const {
278280
border-radius: 0.5rem;
279281
background-color: transparent;
280282
padding: 0.5rem;
283+
}
281284

282-
@media (prefers-reduced-motion: no-preference) {
285+
@media (prefers-reduced-motion: no-preference) {
286+
:where(.modal-close button) {
283287
transition: box-shadow var(--transition-duration) var(--transition-easing);
284288
}
285289
}
@@ -293,35 +297,36 @@ const {
293297
position: relative;
294298
aspect-ratio: 1;
295299
block-size: 20px;
300+
}
296301

297-
svg {
298-
position: absolute;
299-
margin: auto;
300-
inset: 0;
302+
:where(.modal-close-icon svg) {
303+
position: absolute;
304+
margin: auto;
305+
inset: 0;
306+
}
301307

302-
&:first-of-type {
303-
transform: rotate(45deg);
304-
}
308+
:where(.modal-close-icon svg:first-of-type) {
309+
transform: rotate(45deg);
310+
}
305311

306-
&:last-of-type {
307-
transform: rotate(-45deg);
312+
:where(.modal-close-icon svg:last-of-type) {
313+
transform: rotate(-45deg);
314+
}
308315

309-
@media (prefers-reduced-motion: no-preference) {
310-
transition: transform var(--transition-duration) var(--transition-easing);
311-
}
312-
}
316+
@media (prefers-reduced-motion: no-preference) {
317+
:where(.modal-close-icon svg:last-of-type) {
318+
transition: transform var(--transition-duration) var(--transition-easing);
313319
}
314320
}
315321

316-
:where(.modal-close button:hover) .modal-close-icon,
317-
:where(.modal-close button:focus-visible) .modal-close-icon {
318-
svg:first-of-type {
319-
transform: rotate(0deg);
320-
}
322+
:where(.modal-close button:hover) .modal-close-icon svg:first-of-type,
323+
:where(.modal-close button:focus-visible) .modal-close-icon svg:first-of-type {
324+
transform: rotate(0deg);
325+
}
321326

322-
svg:last-of-type {
323-
transform: rotate(180deg);
324-
}
327+
:where(.modal-close button:hover) .modal-close-icon svg:last-of-type,
328+
:where(.modal-close button:focus-visible) .modal-close-icon svg:last-of-type {
329+
transform: rotate(180deg);
325330
}
326331

327332
:global(body:has(dialog[open])) {

src/components/notification/Notification.astro

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,10 @@ const {
102102

103103
:where(.notification) :global(svg) {
104104
flex-shrink: 0;
105+
/* Fallback for browsers without Cascade Layers */
105106
inline-size: 1.5rem;
107+
inline-size: revert-layer;
106108
block-size: auto;
109+
block-size: revert-layer;
107110
}
108111
</style>

src/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export const AvatarGroup: AvatarGroup
6868
* Badge component
6969
*
7070
* @param _props - Record<string, any>
71-
* @param _props.size - Size of the badge ('small' | 'medium' | 'large') - default: 'medium'
71+
* @param _props.size - Size of the badge ('sm' | 'md' | 'lg') - default: 'md'
7272
* @param _props.type - Type/color variant ('info' | 'success' | 'warning' | 'error' | 'default') - default: 'default'
7373
* @param _props.isButton - Whether to render as a button element - default: false
7474
* @param _props.animateOnHover - Whether to animate the icon on hover (only works with isButton) - default: false

0 commit comments

Comments
 (0)