-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
67b1621
commit d2d482b
Showing
10 changed files
with
47 additions
and
10 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
You can animate the `<details>` element with discrete transitions the [`interpolate-size`](https://developer.mozilla.org/en-US/docs/Web/CSS/interpolate-size) property. This example was adapted from [this article](https://nerdy.dev/6-css-snippets-every-front-end-developer-should-know-in-2025#transition-animation-for-%3Ccode%3E%3Cdetails%3E%3C/code%3E) from Adam Argyle. | ||
|
||
Add the same `name` attribute to each details element if you would like to have only one open at a time. Here, `name="accordion"` is applied to each element creating an accordion component. If you are making an accordion component using a UI framework, be sure to generate a unique `name` for each component mounted on the page. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
With [`transition behavior: allow-discrete`](https://tailwindcss.com/docs/transition-behavior#basic-example) in CSS, you can create an animated popover without JavaScript. |
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 @@ | ||
Press | ||
<kbd>tab</kbd> | ||
to view the skip link. | ||
|
||
<a | ||
class="button absolute -top-12 left-56 z-20 focus-visible:translate-y-16 motion-safe:transition-transform" | ||
href="#content" | ||
> | ||
Skip to Content | ||
</a> |
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,3 @@ | ||
Insert a skip link after the opening `body` tag to allow keyboard users to skip directly to the main content on the page. This is useful if you have a long navigation or other elements on the page before the content starts, otherwise keyboard users have to tab through all of theses items before reading the main content. | ||
|
||
In this example, the `<a href="#content">` tag links to the `<article id="content">` element on the page. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export const SkipLink = () => { | ||
return ( | ||
<a | ||
class="button absolute -top-12 left-56 z-20 focus-visible:translate-y-16 motion-safe:transition-transform" | ||
href="#content" | ||
> | ||
Skip to Content | ||
</a> | ||
); | ||
}; |