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

@view-transition css selector different color #244678

Closed
hawkticehurst opened this issue Mar 25, 2025 · 7 comments
Closed

@view-transition css selector different color #244678

hawkticehurst opened this issue Mar 25, 2025 · 7 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug tree-sitter
Milestone

Comments

@hawkticehurst
Copy link
Member

hawkticehurst commented Mar 25, 2025

Testing #244445

Theme: Dark Modern

This selector is not fully supported across all browsers yet (thus the warning), but there's still a difference in syntax highlighting.

Stable:

Image

Insiders:

Image
@view-transition {
  navigation: auto;
}
@hawkticehurst
Copy link
Member Author

hawkticehurst commented Mar 25, 2025

Related: A few more @{selector} selectors have the same issue.

@starting-style

Stable:

Image

Insiders:

Image
@starting-style {
  [popover]:popover-open {
    opacity: 0;
    transform: scaleX(0);
  }
}

@layer

Stable:

Image

Insiders:

Image
@layer reset {
  * {
    box-sizing: border-box;
    margin: 0;
  }
}

@alexr00 alexr00 added this to the April 2025 milestone Apr 2, 2025
@alexr00 alexr00 added bug Issue identified by VS Code Team member as probable bug tree-sitter labels Apr 2, 2025
@alexr00
Copy link
Member

alexr00 commented Apr 4, 2025

@starting-style

Stable:

Image

Insiders:

Image
@starting-style {
  [popover]:popover-open {
    opacity: 0;
    transform: scaleX(0);
  }
}

@hawkticehurst, what do you think the coloring of popover-open should be? Is it a tag or a class?

@alexr00
Copy link
Member

alexr00 commented Apr 4, 2025

at rule coloring is fixed by #245656

@hawkticehurst
Copy link
Member Author

:popover-open is a pseudo-class, so we should apply whatever styling/color we use for those

@hawkticehurst
Copy link
Member Author

hawkticehurst commented Apr 4, 2025

And for what it's worth popover is an attribute that can be applied to any element to turn it into a popover. Thus the attribute bracket syntax: [popover].

<button popovertarget="my-popover">Toggle popover</button>
<section id="my-popover" popover>
  <p>Content inside the popover</p>
</section>

<button popovertarget="my-other-popover">Toggle popover</button>
<div id="my-other-popover" popover>
  <p>Content inside the popover</p>
</div>

<style>
  [popover] {
    /* Default styling for any element with the popover attribute */
  }

  div[popover] {
    /* Specific styling for any div with the popover attribute */
  }

  :popover-open {
    /* Styles applied to any element in the popover-open state */
    /* Note that this pseudo class can be defined on it's own */
  }
</style>

@alexr00
Copy link
Member

alexr00 commented Apr 7, 2025

Thanks for the details! I think we have the correct scopes/colors now:

Image

@alexr00 alexr00 closed this as completed Apr 7, 2025
@hawkticehurst
Copy link
Member Author

Ooh yes agreed! These scopes/colors look great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug tree-sitter
Projects
None yet
Development

No branches or pull requests

2 participants