docs: Update documentation for active link with Tailwind (#2417)
**Proposed change:**
- Document styling for aria-current attribute separately for Tailwind
and Twind.
**Disclaimer:**
I am new to open-source contributions and are unfamiliar with the
process for submitting a pull request. I have found some more areas of
improvement in the Fresh documentation. Should this PR not be
up-to-standards on how to contribute, please guide me in the right
direction. I have a few more suggestions on issues I found while
developing a new Fresh app.
Any guidance would be helpful, either reach out to me on GitHub, Discord
(bastianplsfix) or X (bastianplsfix).
Best,
Sebastian 🦕
This commit is contained in:
@@ -33,14 +33,28 @@ a[aria-current='true'] {
|
|||||||
|
|
||||||
## Tailwind / Twind
|
## Tailwind / Twind
|
||||||
|
|
||||||
In Tailwind or similar CSS frameworks, you can apply styles to elements with the
|
In Tailwind or similar CSS frameworks like Twind, you can apply styles to
|
||||||
aria-current attribute by using bracket notation in your class definitions.
|
elements with the aria-current attribute using bracket notation in your class
|
||||||
|
definitions. However, the specific syntax varies slightly between Tailwind and
|
||||||
|
Twind. For Tailwind, use the syntax:
|
||||||
|
|
||||||
|
```tsx
|
||||||
|
function Menu() {
|
||||||
|
return (
|
||||||
|
<a href="/foo" class="aria-[current]:text-green-600">
|
||||||
|
Link to some page
|
||||||
|
</a>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
For Twind, the syntax is:
|
||||||
|
|
||||||
```tsx
|
```tsx
|
||||||
function Menu() {
|
function Menu() {
|
||||||
return (
|
return (
|
||||||
<a href="/foo" class="[aria-current]:text-green-600">
|
<a href="/foo" class="[aria-current]:text-green-600">
|
||||||
link to some page
|
Link to some page
|
||||||
</a>
|
</a>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user