Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add target: variant #4601

Closed
wants to merge 1 commit into from
Closed

Conversation

seanpdoyle
Copy link
Contributor

The :target pseudo-selector can be used to style an element whose
[id] attribute matches the current URL's hash fragment.

For example:

<div id="section-1" class="border-0 target:border-1"><!-- ... --></div>

<div id="section-2" class="border-0 target:border-1"><!-- ... --></div>

When the URL's path is /#section-1, the #section-1 element's
target: variant will be active (i.e. border-1), and the #section-2
element's will be inactive (i.e. border-0).

The `:target` pseudo-selector can be used to style an element whose
`[id]` attribute matches the current URL's [hash][] fragment.

For example:

```html
<div id="section-1" class="border-0 target:border-1"><!-- ... --></div>

<div id="section-2" class="border-0 target:border-1"><!-- ... --></div>
```

When the URL's path is `/#section-1`, the `#section-1` element's
`target:` variant will be active (i.e. `border-1`), and the `#section-2`
element's will be inactive (i.e. `border-0`).

[:target]: https://developer.mozilla.org/en-US/docs/Web/CSS/:target
[hash]: https://developer.mozilla.org/en-US/docs/Web/API/URL/hash
@seanpdoyle
Copy link
Contributor Author

Whoops! Closing in favor of #4482 and #4409.

@seanpdoyle seanpdoyle closed this Jun 9, 2021
@seanpdoyle seanpdoyle deleted the target-variant branch June 9, 2021 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant