-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
55 composants ajout accessibilité (#69)
* feat(components): add tailwind default structure * feat(a11y): add custom skip link button * feat(link): add default aria label * fix(styles): standardize components naming * fix(headings): standardize components naming
- Loading branch information
1 parent
43319b9
commit 0b3f5e5
Showing
24 changed files
with
183 additions
and
32 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
import "@scripts/navigations/menu"; | ||
import "@scripts/navigations/keyboard"; | ||
|
||
import Alpine from "alpinejs"; | ||
|
||
|
17 changes: 17 additions & 0 deletions
17
web/app/themes/adeliom/assets/scripts/navigations/keyboard.ts
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,17 @@ | ||
const classes = { | ||
tabActive: "tab-active", | ||
}; | ||
|
||
/* | ||
Ajout d'une classe sur le body lorsque l'utilisateur navigue avec la touche tab | ||
*/ | ||
document.addEventListener("keyup", (e) => { | ||
e.keyCode == 9 && | ||
!document.body.classList.contains(classes.tabActive) && | ||
document.body.classList.add(classes.tabActive); | ||
}); | ||
|
||
document.addEventListener("click", () => { | ||
document.body.classList.contains(classes.tabActive) && | ||
document.body.classList.remove(classes.tabActive); | ||
}); |
15 changes: 15 additions & 0 deletions
15
web/app/themes/adeliom/assets/styles/tailwind/components/action/button.pcss
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,15 @@ | ||
@layer components { | ||
.btn { | ||
@apply relative flex items-center justify-center gap-2 transition-colors; | ||
|
||
/* Primary button */ | ||
&--primary { | ||
@apply text-red-600; | ||
} | ||
} | ||
|
||
.skip-link { | ||
@apply pointer-events-none absolute top-1 left-1 overflow-hidden opacity-0; | ||
@apply keyboard:focus:pointer-events-auto keyboard:focus:opacity-100; | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
web/app/themes/adeliom/assets/styles/tailwind/components/action/link.pcss
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,5 @@ | ||
@layer components { | ||
a { | ||
@apply keyboard:focus:outline-0 keyboard:focus:ring keyboard:focus:ring-black; | ||
} | ||
} |
15 changes: 10 additions & 5 deletions
15
web/app/themes/adeliom/assets/styles/tailwind/components/components.pcss
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 |
---|---|---|
@@ -1,5 +1,10 @@ | ||
@layer components { | ||
.my-component { | ||
display: block; | ||
} | ||
} | ||
@import "action/button.pcss"; | ||
@import "action/link.pcss"; | ||
|
||
@import "overlay/modal.pcss"; | ||
|
||
@import "structure/list.pcss"; | ||
|
||
@import "typography/heading.pcss"; | ||
@import "typography/text.pcss"; | ||
@import "typography/wysiwyg.pcss"; |
File renamed without changes.
21 changes: 21 additions & 0 deletions
21
web/app/themes/adeliom/assets/styles/tailwind/components/structure/list.pcss
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,21 @@ | ||
@layer components { | ||
.list { | ||
@apply list-inside space-y-1; | ||
|
||
&--none { | ||
@apply list-none; | ||
} | ||
|
||
&--disc { | ||
@apply list-disc; | ||
|
||
li { | ||
@apply marker:mr-2 marker:text-black; | ||
} | ||
} | ||
|
||
&--decimal { | ||
@apply list-decimal; | ||
} | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
web/app/themes/adeliom/assets/styles/tailwind/components/typography/heading.pcss
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,37 @@ | ||
@layer components { | ||
.heading { | ||
@apply dark:text-white; | ||
} | ||
|
||
.heading-1 { | ||
@apply text-5xl md:text-6xl lg:text-7xl; | ||
} | ||
|
||
.heading-2 { | ||
@apply text-4xl md:text-5xl lg:text-6xl; | ||
} | ||
|
||
.heading-3 { | ||
@apply text-3xl md:text-4xl lg:text-5xl; | ||
} | ||
|
||
.heading-4 { | ||
@apply text-2xl md:text-3xl lg:text-4xl; | ||
} | ||
|
||
.heading-5 { | ||
@apply text-xl md:text-2xl lg:text-3xl; | ||
} | ||
|
||
.heading-6 { | ||
@apply text-lg md:text-xl lg:text-2xl; | ||
} | ||
|
||
.heading-7 { | ||
@apply text-base md:text-lg lg:text-xl; | ||
} | ||
|
||
.headline { | ||
@apply uppercase tracking-wider; | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
web/app/themes/adeliom/assets/styles/tailwind/components/typography/text.pcss
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,10 @@ | ||
@layer components { | ||
div, | ||
p { | ||
@apply dark:text-white; | ||
} | ||
|
||
.tag { | ||
@apply py-1 px-2 text-sm font-bold text-white; | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
web/app/themes/adeliom/assets/styles/tailwind/components/typography/wysiwyg.pcss
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,34 @@ | ||
.wysiwyg { | ||
.h2 { | ||
@apply heading heading-2; | ||
} | ||
|
||
.h3 { | ||
@apply heading heading-3; | ||
} | ||
|
||
.h4 { | ||
@apply heading heading-4; | ||
} | ||
|
||
.h5 { | ||
@apply heading heading-5; | ||
} | ||
|
||
a:not(.btn) { | ||
@apply font-bold underline transition lg:hover:opacity-80; | ||
} | ||
|
||
ul, | ||
ol { | ||
@apply flex flex-col gap-2; | ||
} | ||
|
||
ul { | ||
@apply list list--disc; | ||
} | ||
|
||
ol { | ||
@apply list list--decimal; | ||
} | ||
} |
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
2 changes: 1 addition & 1 deletion
2
web/app/themes/adeliom/views/blocks/content/three-cards.html.twig
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
2 changes: 1 addition & 1 deletion
2
web/app/themes/adeliom/views/blocks/content/title-text.html.twig
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
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
File renamed without changes.
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
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
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
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