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

Components: ColorPicker needs better styling when used outside of WordPress #18129

Closed
gziolo opened this issue Oct 28, 2019 · 4 comments · Fixed by #18448
Closed

Components: ColorPicker needs better styling when used outside of WordPress #18129

gziolo opened this issue Oct 28, 2019 · 4 comments · Fixed by #18448
Assignees
Labels
[Feature] UI Components Impacts or related to the UI component system Needs Design Needs design efforts. [Package] Components /packages/components Storybook Storybook and its stories for components [Type] Bug An existing feature does not function as intended

Comments

@gziolo
Copy link
Member

gziolo commented Oct 28, 2019

Describe the bug
Originally reported in #18013 (comment):

There is some follow-up work required to make this component work properly outside of WordPress:

Screen Shot 2019-10-28 at 08 03 54
Screen Shot 2019-10-28 at 08 04 17

To reproduce
Steps to reproduce the behavior:

  1. Run Storybook: npm run design-system:dev.
  2. Go to the ColorPicker section.
  3. Use the arrow button to change the type of color format input and observe UI.

Expected behavior
Default styles should be more polished. /cc @enriquesanchez @mapk

@gziolo gziolo added [Type] Bug An existing feature does not function as intended Needs Design Needs design efforts. [Feature] UI Components Impacts or related to the UI component system [Package] Components /packages/components labels Oct 28, 2019
@gziolo gziolo added the Storybook Storybook and its stories for components label Oct 31, 2019
@mapk
Copy link
Contributor

mapk commented Nov 6, 2019

Looks like some of these styling issues may be happening within Gutenberg as well.

color 2019-11-06 12_22_19

@enriquesanchez you mind taking a look at this one?

@enriquesanchez enriquesanchez self-assigned this Nov 6, 2019
@enriquesanchez
Copy link
Contributor

@gziolo I have a couple of questions:

  1. I'm noticing that there are some global styles missing, or at least I'm used to seeing them applied globally to Gutenberg. For example, box-sizing: border-box; does not appear to be included on this component. Are these missing on purpose? Can they be added globally to the components in Storybook?

  2. How much can this component be changed?

Aside from the alignment issues, I wonder if we can also make that arrow icon more descriptive of what it does?

I think it'd be much better if we at least showed the current color format so it's a bit more obvious that clicking on it would let you change that. Something like this:

Screen Shot 2019-11-06 at 3 49 03 PM

Where Hex appears next to the arrow, and if I were to select RGB:

Screen Shot 2019-11-06 at 3 53 20 PM

@gziolo
Copy link
Member Author

gziolo commented Nov 7, 2019

  1. I'm noticing that there are some global styles missing, or at least I'm used to seeing them applied globally to Gutenberg. For example, box-sizing: border-box; does not appear to be included on this component. Are these missing on purpose? Can they be added globally to the components in Storybook?

I have no idea to be honest. @jasmussen, @karmatosed, @mapk or @melchoyce, might be better suited to answer this question. Do those styles are defined in Gutenberg or WordPress?

How much can this component be changed?

Again, the same group I mentioned will know best. Ideally, they should look similar in Storybook and in Wordpress :)

@jasmussen
Copy link
Contributor

For example, box-sizing: border-box; does not appear to be included on this component.

Arguably, box-sizing: border-box; should be applied everywhere and unset, as opposed to the other way around as is the case in browsers now. Because it is a much more logical way to work with paddings, borders and margins than the default box model.

However the reality is that we are stuck with a world where box-sizing: content-box; is the default. Given this fact, and the fact that we are now increasingly using components outside of WordPress, it's becoming clear that we can no longer develop compnents assuming the box sizing will be border-box. Therefore, any CSS changes you make should re-apply box-sizing: border-box; on a per-component basis, when you know they are necessary.

Again, the same group I mentioned will know best. Ideally, they should look similar in Storybook and in Wordpress :)

Your dropdown assessment is one I would agree with. I say change it if the change makes it better. Only make sure that the change happens for the component globally, i.e. both WP and Storybook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] UI Components Impacts or related to the UI component system Needs Design Needs design efforts. [Package] Components /packages/components Storybook Storybook and its stories for components [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants