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

[color-swatch] --details-style: compact does not cover use cases well #194

Open
LeaVerou opened this issue Jan 16, 2025 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@LeaVerou
Copy link
Member

LeaVerou commented Jan 16, 2025

Currently, this is too all or nothing: either show all details under the color, or all in the popup. There are many cases where you want to show some details under the swatch and some in the popup. E.g. a very common scenario is to show the color name under it, but the color coordinates in the popup. There are even cases where you want to show some info in the popup and others under the scale, though that's more rare.

There are 3 types of info:

  • Color name
  • Color code
  • info (specified via info and vs)

Additionally, --details-style: compact was designed to be high level, the theory being that a popup was just one of many potential compact renderings. However, in reality there aren't any others, and this is just ...awkward.

I propose, a popup attribute (and corresponding --color-swatch-popup CSS property) with a grammar like:

--color-swatch-popup: [ name || code || info ] | none

Additionally, when the attribute is used instead of the CSS property, we could take care of the tabindex thing too. Eventually, we could use a style observer to monitor the property too and apply it then as well.

Perhaps later we could add a popupinfo attribute with info just for the popup, but that's very low priority.

@LeaVerou LeaVerou added the enhancement New feature or request label Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant