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

Standardizes the style of <input type="checkbox" switch> #9738

Open
yisibl opened this issue Dec 21, 2023 · 5 comments
Open

Standardizes the style of <input type="checkbox" switch> #9738

yisibl opened this issue Dec 21, 2023 · 5 comments
Labels
css-pseudo-4 Current Work css-ui-4 Current Work

Comments

@yisibl
Copy link
Contributor

yisibl commented Dec 21, 2023

Apple is pushing to add standardized switches to the HTML specification, and CSS needs to define exactly which pseudo-elements are needed for most cases.

Many UI frameworks have switch components

Normal

https://codepen.io/billyysea/pen/ndzGXm
image

https://codepen.io/AbubakerSaeed/pen/ExYyRQd
image

https://codepen.io/aanjulena/pen/ZLZjzV
image

https://codepen.io/personable/pen/NWLZrV
image

Includes animation

https://codepen.io/montechristos/pen/EPvOwJ

2023-12-21.14-44-33.mp4

https://codepen.io/aaroniker/pen/oNvwzZO

2023-12-21.14-54-16.mp4

https://codepen.io/jh3y/pen/LYNZwGm

2023-12-21.14-55-51.mp4

https://codepen.io/ykadosh/pen/jOwjmJe

2023-12-21.14-57-06.mp4

https://codepen.io/havardob/pen/EKMZbG

2023-12-21.14-58-35.mp4
@nt1m
Copy link
Member

nt1m commented Dec 21, 2023

The ::thumb / ::track pseudos that Safari has implemented were resolved in #4410

@yisibl
Copy link
Contributor Author

yisibl commented Dec 21, 2023

@nt1m So these two pseudo-elements can cover the above use cases?

@nt1m
Copy link
Member

nt1m commented Dec 21, 2023

Yes, these + ::before + ::after pretty much cover all the use cases above.

@lukewarlow
Copy link
Member

openui/open-ui#785 - It's worth keeping the openui proposal in mind too.

@fantasai fantasai added css-pseudo-4 Current Work css-ui-4 Current Work labels Jan 9, 2024
@yisibl
Copy link
Contributor Author

yisibl commented Jan 22, 2024

In addition, we need to clarify whether these pseudo-elements should support the content property. See openui/open-ui#959 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css-pseudo-4 Current Work css-ui-4 Current Work
Projects
None yet
Development

No branches or pull requests

4 participants