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

Make use of CSS :has() #6844

Open
wants to merge 2 commits into
base: v5/develop
Choose a base branch
from
Open

Make use of CSS :has() #6844

wants to merge 2 commits into from

Conversation

distantnative
Copy link
Member

@distantnative distantnative commented Dec 7, 2024

Description

Reasoning

We already have started again to use :has() in many places. It might be time to bring all these back as well. I couldn't notice any performance issues in Firefox this time.

Changelog

Breaking changes

  • <k-item>: Removed data-only-option attributes
  • <k-dialog>: Removed data-has-footer attribute
  • <k-toggles-input>: Removed data-disabled attribute
  • <k-writer-input>: Removed data-toolbar-inline attribute
  • <k-bubble>: Removed data-has-text attribute
  • <k-header>: Removed data-has-buttons attribute
  • <k-tag>: Removed data-has-image and data-has-toggle attributes
  • <k-tree>: Removed data-has-subtree attribute

Ready?

  • Tests and CI checks all pass

For review team

  • Add changes & docs to release notes draft in Notion

@distantnative distantnative self-assigned this Dec 7, 2024
@distantnative distantnative added this to the 5.0.0-beta.2 milestone Dec 7, 2024
@distantnative distantnative marked this pull request as ready for review December 7, 2024 17:40
@bastianallgeier
Copy link
Member

I wonder if we should switch the css rules, but still keep the data attributes a little longer. They migth still be useful as hooks for custom styles.

@distantnative
Copy link
Member Author

I'd love to steer people away from these data attributes as soon as possible.

@nilshoerrmann
Copy link
Contributor

Removing the data attributes will be huge breaking change for many projects. Make sure to communicate this loudly if you proceed in that direction. It's a good idea in general 👍 but it will be disruptive for existing projects 🚨

@distantnative
Copy link
Member Author

We of course need to communicate it properly. That's why they're all listed as breaking changes in the initial post.

I am still wondering if these specific data attributes are really used in "many projects". What are the use cases in projects for these?

Copy link
Member

@bastianallgeier bastianallgeier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's good to clean up, but there are parts that are easier to read with the data attributes (in my opinion) or provide a bit more selector safety. I've tried to go through all the different changes and comment accordingly. I hope it helps to get this done.

panel/src/components/Collection/Item.vue Outdated Show resolved Hide resolved
panel/src/components/Forms/Field/BlocksField.vue Outdated Show resolved Hide resolved
panel/src/components/Forms/Field/DateField.vue Outdated Show resolved Hide resolved
panel/src/components/Forms/Field/LayoutField.vue Outdated Show resolved Hide resolved
panel/src/components/Forms/Field/StructureField.vue Outdated Show resolved Hide resolved
panel/src/components/Navigation/Button.vue Outdated Show resolved Hide resolved
panel/src/components/Views/Files/FileView.vue Outdated Show resolved Hide resolved
panel/src/components/Views/Pages/PageView.vue Outdated Show resolved Hide resolved
panel/src/components/Views/Pages/SiteView.vue Outdated Show resolved Hide resolved
panel/src/components/Views/Users/UserView.vue Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants