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

Palette swap for accessibility / kibana 6 #12085

Merged
merged 50 commits into from
Jun 13, 2017
Merged

Conversation

snide
Copy link
Contributor

@snide snide commented May 30, 2017

Replaces #11610

Description

This PR reskins a decent portion of Kibana to be mostly AA accessibility compatible in regards to coloring of major navigation elements.

A note on our less / sass and variables

Kibana has a pretty messy css compile path with both less and sass in play. Right now we have a couple parallel build processes that don't talk to each other all that well. The best way I could think to uniformly style them all was to add some global variables to the less and sass files and then carry that through the existing structure. In general I think this method is a band-aid to get the job done. I think a decent portion of the core css systems need to be rebuilt, and at that time, a proper variable / theming structure should be put in place.

A note to reviewers

I tried to avoid touching the template layer when possible, and tried to keep my changes to the css layer only. There are a few cases where I had to touch templates though, and since I'm not as familiar with the areas I'm touching please take a look at those first.

I'd also mention that these color changes may look more minimal than they actually are. Again, I don't know every corner of Kibana, so if you notice a color problem, please take a screen shot and give me a short note on how to recreate it.

Addresses #11521

image

image

image

image

image

image

Release Note: We re-skinned a decent portion of Kibana to be mostly AA accessibility compatible in regards to coloring of major navigation elements.

@snide snide changed the title 11521/colors again [WIP] Palette swap for accessibility / kibana 6 May 30, 2017
@cjcenizal
Copy link
Contributor

Weird functional test failure:

10:34:18.011  warn  Failure loading service "remote"
10:34:18.014 ERROR  Error: remote failed to start within 2 minutes
10:34:18.014            at /var/lib/jenkins/workspace/elastic+kibana+pull-request+multijob-selenium/test/functional/services/remote/leadfoot_command.js:13:13
10:34:18.014            at undefined.next (native)
10:34:18.015            at step (/var/lib/jenkins/workspace/elastic+kibana+pull-request+multijob-selenium/test/functional/services/remote/leadfoot_command.js:5:1)
10:34:18.015            at /var/lib/jenkins/workspace/elastic+kibana+pull-request+multijob-selenium/test/functional/services/remote/leadfoot_command.js:5:1
Warning: Error: Failure initializing 1 service(s)
    at /var/lib/jenkins/workspace/elastic+kibana+pull-request+multijob-selenium/src/functional_test_runner/lib/providers/provider_collection.js:48:13
    at undefined.next (native)
    at step (/var/lib/jenkins/workspace/elastic+kibana+pull-request+multijob-selenium/src/functional_test_runner/lib/providers/provider_collection.js:2:1)
    at /var/lib/jenkins/workspace/elastic+kibana+pull-request+multijob-selenium/src/functional_test_runner/lib/providers/provider_collection.js:2:1� Use --force to continue.

jenkins, test this

@snide snide added Project:Accessibility Team:Platform-Design Team Label for Kibana Design Team. Support the Analyze group of plugins. v6.0.0-alpha2 v6.0.0 and removed v6.0.0-alpha2 labels May 30, 2017
@snide snide requested a review from cjcenizal May 31, 2017 18:02
@snide
Copy link
Contributor Author

snide commented May 31, 2017

@cjcenizal Still working through dark mode and some small stuff around the panels within the tables, but feel free to start poking at this.

@snide snide requested a review from epixa May 31, 2017 18:03
@cjcenizal
Copy link
Contributor

You should be able to rebase master onto this branch to get the tests passing. Shouldn't be any conflicts this time! But if there are... you know what to do. 💥 🔫

@snide snide force-pushed the 11521/colors_again branch from cf36ca6 to da42250 Compare June 1, 2017 16:40
@cjcenizal
Copy link
Contributor

Link contrast

When someone is fully color-blind, it's pretty tough to differentiate links from regular text. The obvious solution is to add an underline, but if we can't do that maybe we can change the lightness.

image

Dark theme

The query bar doesn't contrast very well against the background. Maybe we should use an outline treatment, similar to the light theme?

image

The text and other inputs also looks a little low-contrast. Maybe we bump up the contrast on the text and add outlines around the inputs.

image

The "Set to now" buttons look a little weird, and maybe we can create a dark theme version of checkboxes to use in the Datepicker?

image

Looks like the focus state of the Datepicker button is also incorrect:

image

Spy

Looks like the spy puts gray text on gray background in a couple places:

image

Discover

The color highlighting of the JSON view looks a little desaturated.

image

Maybe we can try matching the colors in Console?

image

The existing treatment of the field names in the table applies a semi-transparent background colors so it blends with the blue highlight of the row in the Context Log. We should probably preserve something like that to avoid this kind of vibrating contrast (btw the +/- button backgrounds are being fixed by @weltenwort in #11819):

image

Visualize

The index pattern bar really stands out! Can we make this a little more subdued? I'm not sure why it needs to be so high in the visual hierarchy.

image

image

There's quite a bit of vertical white-space between some sections. Maybe it can be reduced?

image

Does the vertical line denoting sections need to be blue? It seems like this is our attention-getting color (sidebar, primary buttons). Might be better to make this gray instead?

image

TSVB

The axis labels and legend labes in TSVB are really light and hard to read.

image

Dashboards

You mentioned this already, that there's some weirdness with the way our tables appear when they have a feedback message.

image

On a semi-related note, I love how you treated the "dashboard is empty" message. How would you feel about turning this into a component in the UI Framework, and reusing it in tables?

image

Dev Tools

The light blue (#40b0d3) on gray (#dbdcdd) fails the WebAIM Contrast Checker:

image

Looks like this color scheme is reused in the history:

image

@epixa
Copy link
Contributor

epixa commented Jun 1, 2017

One thing I'd like to urge here is separating feedback into "must have to make this as good if not better than what we have now" and "must be done for compliance reasons". We can continue to iterate on the latter after this PR gets merged, whereas we don't want things to get worse when we merge this PR. Progress over perfection, etc. etc.

@snide snide changed the title [WIP] Palette swap for accessibility / kibana 6 Palette swap for accessibility / kibana 6 Jun 1, 2017
@cjcenizal
Copy link
Contributor

jenkins, test this

@snide
Copy link
Contributor Author

snide commented Jun 5, 2017

@cjcenizal Think I got most of these. I'd like to avoid styling our syntax highlighters just yet. We use quite a few different ones and it would probably take me a bit to get that stuff where I'm happy with it.

TSVB uses canvas and while I'd love to dig deep into @simianhacker's codebase it would likely similarly take me awhile to get those visuals consistent with everything else. I'll schedule out a review with him later and I can tackle that in a separate PR. Think since we label that one with "experimental" right now anyway it's OK to wait on. I wouldn't mind spending time working on that UI as a full PR of work. As it is now I've left it mostly unchanged.

@cjcenizal
Copy link
Contributor

Looks like the Visualize functional tests are failing because it can't find some elements. My guess is that some of the selectors in the page object use CSS class names to find elements, but those class names changed? I can take a closer look tomorrow.

@snide snide force-pushed the 11521/colors_again branch from c4723a6 to a783b83 Compare June 6, 2017 16:03
@cjcenizal
Copy link
Contributor

cjcenizal commented Jun 8, 2017

Discover

LocalNav

When the query bar has focus state, the "Uses lucene query syntax" link is invisible.

image

The "Add filter" link doesn't have a very clear focus state.

image

Table

The tooltip in the chart has labels that are pretty hard for me to read. This is backed up by the WebAIM contrast checker, which fails AAA for #3394b7 on #00090C. Why use blue in this situation? Can we use white with a bold treatment, like the way the rest of our labels are treated?

image

Context Log

The backgrounds of the +/- icons are white. I think this is fixed by #11819, so we're semi-blocked by that PR.

image

@snide
Copy link
Contributor Author

snide commented Jun 8, 2017

The all white coloring isn't enough definition between the elements. It passes AA, which is what is our goal was. Gonna leave that one as is, or possibly lighten the blue.

I'll fix the focus on the filter. Looks like someone added an overflow on the surrounding block (which hides the shadow). Can't see any other reason other than they wanted to avoid dealing with a vertical height issue.

Will also fix the query syntax focus. Good catch.

@snide
Copy link
Contributor Author

snide commented Jun 8, 2017

@cjcenizal Issues are fixed outside of that one outside PR.

display: flex;
flex-direction: column;

height: 482px;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@cjcenizal @thomasneirynck

I couldn't figure out why this rule existed and where such a specific number came from. I made some changes to the overflow / height states of the spy to make it actually usable within discovery. I checked that this doesn't effect the spy within dashboard and the visualize creation itself, but wanted to pass it by you just in case there's some part of Kibana I missed that actually requires this to exist.

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like it was just old code.

@cjcenizal
Copy link
Contributor

cjcenizal commented Jun 8, 2017

This is looking fantastic! Thanks for improving the legibility of the tooltip labels. As a user, I don't have such a hard time reading them now.

I've organized the things I've found into "Blockers", "Nice-to-have", and "Do later" buckets, based on @epixa's comment above.

Blockers

  • Tabs change in height when focused.

This is caused by padding-bottom: 11px; /* 4 */ on line 46 of _tabs.scss in the UI Framework. If we remove that line and the corresponding comment we should be fine. Marked a blocker because this doesn't happen in master.

image

  • Index pattern focus state isn't visible in "Index Patterns" side bar.

Referring to the "logstash-*" button below the "Create index pattern" button. This focus state is easy to see in master.

image

  • Timepicker checkbox focus states aren't visible.

Referring to the "round to the minute/second" checkbox. I think this a blocker because they're visible in master.

image

  • kuiLocalDropdownInput elements don't have visible focus states.

This is a global thing so we should probably address this in the UI Framework. I think it's a blocker because the focus states are visible in master.

image

  • Discover sidebar checkboxes don't have visible focus states.

The states are visible on master so it's a blocker.

image

Nice-to-have

  • Timepicker day focus state is hard to see in dark theme.

As a user, it's easier for me to see the lighter blue in master. Didn't look up the math.

image

  • Timelion text area and buttons have double-outlines when focused.

It seems like their classes have focus states, but they're also inheriting a global *:focus selector. Marked as nice-to-have because it looks a little weird, but it's still functional... a little too functional! 😄

image

Do later

  • Table and ToolBar use slightly different gray colors for their borders.

They're just barely different so I think we can just do this later.

image

  • Bootstrap tabs have weird focus states.

They already have this weird focus state so I think we can address it later.

image

  • Visualization panel "full-screen" button is hard to see in dark theme.

Blue on dark gray is difficult to read. We probably just need better dark theme styles for the hollow button.

image

  • Spy panel button isn't visible in dark theme.

This exists in master already.

image

  • Visualize "Play" and "Reset" button focus states aren't visible.

This behavior exists in master already and also be addressed by #11094.

image

@snide
Copy link
Contributor Author

snide commented Jun 9, 2017

@cjcenizal All blockers are addressed (and a couple non-blockers as well). I couldn't replicate the toaster one. You'll need to provide the pattern to get to it.

@snide snide force-pushed the 11521/colors_again branch from 4b57f8c to 495af49 Compare June 12, 2017 17:17
@snide
Copy link
Contributor Author

snide commented Jun 12, 2017

@epixa Rebased. Unfortunately this branch touches so much it slips into conflict pretty regularly anytime css is changed.

Side note, would love to not commit compiled CSS into master for this reason. Be nice if that was just a part of our build process.

@epixa
Copy link
Contributor

epixa commented Jun 12, 2017

@snide Understood. All the more reason to get this thing in asap. Keeping it open is a drain.

I completely agree about not checking in the css. The current build system muddies the water between what is a behavior in release builds and what is a behavior for development, so the only way to not commit the css would be to ship sass with releases, but that's not doable since sass is a native module and thus needs to be compiled on the OS that it is intended to run on. The new build system will address this.

@epixa
Copy link
Contributor

epixa commented Jun 12, 2017

Looks like there was a network error in CI when trying to get the latest node builds.

jenkins, test this

Copy link
Contributor

@epixa epixa left a comment

Choose a reason for hiding this comment

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

There are minor style details here and there that we should improve upon, but I didn't see anything that warrants blocking this PR in particular. With a PR like this, far more issues will surface when people start using it than they will in a single PR review.

LGTM

Copy link
Contributor

@cjcenizal cjcenizal left a comment

Choose a reason for hiding this comment

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

Beautiful work @snide. I know you think the CSS actually got worse, but I think the addition of new variables and the new rules which tie certain parts of the UI is a step in the right direction.

I had a few very minor comments and then I think we're good to go. I'll start moving the unaddressed visual items into their own issues.

<a class="vis-editor-subnav-link vis-editor-subnav-link--danger">
<span class="kuiIcon fa-warning"></span>
<a class="kuiButton kuiButton--danger navbar-btn-link">
<i class="fa fa-warning"></i>
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be <span> since <i> is non-semantic.

margin-left: -@vis-editor-agg-editor-spacing;
// margin-bottom: -@vis-editor-agg-editor-spacing - 1; // extra one pixel covers the aggs bottom border
// margin-right: -@vis-editor-agg-editor-spacing;
// margin-left: -@vis-editor-agg-editor-spacing;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can delete this entire class.

Copy link
Contributor

Choose a reason for hiding this comment

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

We can also remove it from the markup on line 93 of agg.html.

data-test-subj="docTableRowAction"
ng-href="{{ getContextAppHref() }}"
ng-if="indexPattern.isTimeBased()"
>
View surrounding documents
</a>
<a
class="kuiLink documentTableRow__action"
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we delete the .documentTableRow__action class on line 15 of table_row.less?

border-radius: 4px;
}

.kuiSideBarSection .kuiSideBarSection .kuiSideBarSection{
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we either create a class for this and update the markup, or create a brief ticket so we don't forget? I think this one stands out because the solution seems pretty trivial, and the existing selector is potentially pretty confusing for people.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd rather do this in a separate refactor. Currently those three tabs are all using different markup and I'm faking them all to look the same with separate css. This whole bit needs a lot of work and because of the way these templates sub nested each other I didn't have enough angular to better specify the classes (if I recall correctly).

* Using a random color generator presented awful colors and unpredictable color schemes.
* So we needed to come up with a color scheme of our own that creates consistent, pleasing color patterns.
* The order allows us to guarantee that 1st, 2nd, 3rd, etc values always get the same color.
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

Why remove this comment?

}

.kuiPanel--withHeader {
// border-top: none;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can delete this class.

Also, we need to replace kuiPanel--withHeader with kuiPanel--withToolbar in two places:

  • Line 15 of src/core_plugins/kibana/public/management/landing.html
  • Line 1 of src/ui/public/table_info/table_info.html

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, the border for the Panel is #E4E4E4 but the border for the ToolBar is #D9D9D9. We should probably use the same value for both.

// border-top: none;
}

.kuiPanel--withToolbar {
Copy link
Contributor

@cjcenizal cjcenizal Jun 12, 2017

Choose a reason for hiding this comment

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

Can we rename this kuiPanel--withToolBar (capital B) to be consistent with the casing of the ToolBar component?

@@ -26,6 +26,7 @@ const buttonTypeToClassNameMap = {
danger: 'kuiButton--danger',
warning: 'kuiButton--warning',
primary: 'kuiButton--primary',
secondary: 'kuiButton--secondary',
Copy link
Contributor

Choose a reason for hiding this comment

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

I love that you're updating the React components too! On line 8 we need to make a change to match the change you've made here. Line 8 needs to be updated to be:

const BUTTON_TYPES = [
  'basic',
  'hollow',
  'danger',
  'warning',
  'primary',
  'secondary',
];

This defines the allowed values, so now "secondary" will be accepted as a valid type.

Copy link
Contributor

@cjcenizal cjcenizal left a comment

Choose a reason for hiding this comment

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

This looks so frickin' good dude!

Just a couple last things and then let's merge this sucker:

  1. We can delete the .kuiPanel--withHeader class from the UI Framework.
  2. We need to update components/empty_table_prompt/empty_table_prompt_panel.js to use the kuiPanel--withToolBar class instead of the old withHeader class.

@cjcenizal
Copy link
Contributor

cjcenizal commented Jun 13, 2017

Also you need to run node scripts/jest --coverage and commit the results, to update the tests for the React Button component you changed. This will get the tests passing.

@snide
Copy link
Contributor Author

snide commented Jun 13, 2017

@cjcenizal Done. We should find one more commit for good luck.

@cjcenizal
Copy link
Contributor

jenkins, test this

@epixa
Copy link
Contributor

epixa commented Jun 13, 2017

The top border on management sections is missing:
screen shot 2017-06-13 at 2 45 56 pm

The tabs on the saved objects list are separated from the content, which looks strange:
screen shot 2017-06-13 at 2 47 36 pm

I'm fine with not blocking this PR on either of these if we follow up with fixes after merging.

LGTM

@snide
Copy link
Contributor Author

snide commented Jun 13, 2017

@epixa Fixed the management panels. The tabbing stuff is more of design problem that exists in master as well. Nothing really changed there (agree it's really awkward though).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Project:Accessibility release_note:enhancement review Team:Platform-Design Team Label for Kibana Design Team. Support the Analyze group of plugins. v6.0.0-rc1 v6.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants