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

Commits on Jun 9, 2021

  1. Add target: variant

    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 committed Jun 9, 2021
    Configuration menu
    Copy the full SHA
    96b5ba0 View commit details
    Browse the repository at this point in the history