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 1 commit into
base: v5/develop
Choose a base branch
from
Open

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-has-image and data-only-option attributes
  • <k-dialog>: Removed data-has-footer attribute
  • <k-date-field>: Removed data-has-time attribute
  • <k-toggles-input>: Removed data-disabled attribute
  • <k-writer-input>: Removed data-toolbar-inline attribute
  • <k-page-view>, <k-site-view>, <k-file-view>, <k-user-view>: Removed data-has-tabs attribute and hasTabs computed props
  • <k-bubble>: Removed data-has-text attribute
  • <k-header>: Removed data-has-buttons attribute
  • <k-button>: Removed data-has-image and data-has-text attributes
  • <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 added the type: refactoring ♻️ Is about bad code; cleans up code label 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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: refactoring ♻️ Is about bad code; cleans up code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants