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

Theme: ComboBox #258

Merged
merged 14 commits into from
Aug 9, 2017
Merged

Theme: ComboBox #258

merged 14 commits into from
Aug 9, 2017

Conversation

bitpshr
Copy link
Member

@bitpshr bitpshr commented Jul 19, 2017

Type: feature

The following has been addressed in the PR:

  • There is a related issue
  • All code matches the style guide
  • Unit or Functional tests are included in the PR

Description:

This PR adds an initial theme for the ComboBox component. Note that this work was based off @smhigley's TextInput theme PR.

screen shot 2017-07-19 at 10 27 26 am

@bitpshr bitpshr requested review from tomdye and smhigley July 19, 2017 14:43
Copy link
Contributor

@smhigley smhigley left a comment

Choose a reason for hiding this comment

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

Some questions, and a couple focus styles. Looks good! Since it seems to be branched off textinput/textarea styles, maybe it should get merged after that PR?

@@ -401,7 +401,6 @@ export default class ComboBox extends ComboBoxBase<ComboBoxProperties> {
readOnly,
onclick: this._onArrowClick
}, [
'open combo box',
Copy link
Contributor

Choose a reason for hiding this comment

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

Why delete the text? It needs some sort of label, could either be this text wrapped in a visually hidden span, or an aria-label on the button

position: absolute;
right: 0;
top: var(--border-width);
z-index: 1;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Since combobox can have the arrow focused on separately from the input, I think this needs separate focus styles

width: 100%;
padding-right: 2em;
z-index: 2;
Copy link
Contributor

Choose a reason for hiding this comment

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

We probably need some sort of consistent approach to z-indices. Maybe something like this?

  • 10: stuff like this that appears over surrounding inline content (this, tooltips, menus)
  • 20: block-level items that need to appear over all other normal page content (e.g. sticky navs, alerts)
  • 30: modal overlays
  • 40: modal content

I'm probably missing use cases, but I think it'd be good to use and document some sort of system

Copy link
Contributor

Choose a reason for hiding this comment

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

We could even put them in variables 😁

Copy link
Member Author

Choose a reason for hiding this comment

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

Agreed, good catch. I will do this as part of a separate PR, this will effect SlidePane and Dialog (at least) once they land.

position: absolute;
right: calc(var(--spacing-regular) * 6);
top: 50%;
transform: translateY(-50%);
Copy link
Contributor

Choose a reason for hiding this comment

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

Could possibly use a focus style too

Copy link
Member Author

Choose a reason for hiding this comment

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

Added.

cursor: pointer;
padding: var(--input-padding);
.invalid .trigger {
border-left-color: color(var(--color-error) saturation(-9%) lightness(+37%));
Copy link
Contributor

Choose a reason for hiding this comment

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

This color (and the success variation) is getting used in more places than I thought. Do you think it's worth thinking of another variable name?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm fine with color-error and color-success since they provide abstraction from the underlying color. Personally I don't find myself wishing I had more abstraction, but I'm open.

width: 100%;
}

.trigger {
Copy link
Member

Choose a reason for hiding this comment

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

is it possible to move some of this styling to a shared file? Looks like combo / select / textbox have the same styling

Copy link
Member Author

Choose a reason for hiding this comment

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

Totally agreed. We have #117 to track that progress, as it's more involved than just pulling out common styling. The underlying DOM is still somewhat different and would require some consolidation.

I definitely think we need to take care of that ticket asap though.

@codecov
Copy link

codecov bot commented Jul 21, 2017

Codecov Report

Merging #258 into master will decrease coverage by 0.13%.
The diff coverage is 33.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #258      +/-   ##
==========================================
- Coverage   98.78%   98.64%   -0.14%     
==========================================
  Files          24       24              
  Lines        1478     1481       +3     
  Branches      436      439       +3     
==========================================
+ Hits         1460     1461       +1     
- Partials       18       20       +2
Impacted Files Coverage Δ
src/combobox/ComboBox.ts 98.28% <33.33%> (-1.14%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8b4b841...a462537. Read the comment docs.

@bitpshr
Copy link
Member Author

bitpshr commented Jul 21, 2017

@tomdye @smhigley this should be ready for another review.

@dylans dylans modified the milestones: 2017.07, 2017.08 Jul 29, 2017
@bitpshr
Copy link
Member Author

bitpshr commented Jul 31, 2017

Bump @smhigley and @tomdye for a review. Thanks!

@@ -142,7 +142,9 @@ export class App extends WidgetBase<WidgetProperties> {
}

render(): DNode {
return v('div', [
return v('div', {
styles: { maxWidth: '256px' }
Copy link
Member

Choose a reason for hiding this comment

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

i assume this is to restrict the width of the inputs, should they not have their own max width?

Copy link
Contributor

Choose a reason for hiding this comment

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

Based on talking with Scott, I believe we decided no max width. It makes a certain sort of sense -- desired width can be really variable (no pun intended, mostly), and controlling input width through styles on the containing element seems like a better pattern anyway.

Copy link
Contributor

Choose a reason for hiding this comment

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

@bitpshr I actually wouldn't mind this added to textinput/textarea too, if you feel like it

font-style: italic;
cursor: default;
.clear:focus {
border-color: var(--color-highlight);
Copy link
Contributor

Choose a reason for hiding this comment

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

I know I'm being super nitpicky (😔), but the border isn't the most beautiful of styles. Maybe Scott would have some ideas?

Copy link
Member Author

@bitpshr bitpshr Aug 9, 2017

Choose a reason for hiding this comment

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

Agreed. I will call this out to Scott during his sweep.

Copy link
Contributor

@smhigley smhigley left a comment

Choose a reason for hiding this comment

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

I could do with prettier clear button focus styles, but I also think it'd be good for Scott to review all styles in action after the theme PRs are in. Either way, I'm fine with you merging this now 👍

@bitpshr bitpshr merged commit eaee111 into dojo:master Aug 9, 2017
@bitpshr bitpshr deleted the combobox-theme-new branch August 9, 2017 12:29
@bitpshr bitpshr mentioned this pull request Aug 9, 2017
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants