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

style: push bootstrap theme towards SIP-34 styles #10056

Merged
merged 8 commits into from Jun 18, 2020

Conversation

mistercrunch
Copy link
Member

@mistercrunch mistercrunch commented Jun 15, 2020

Spent 1-2 hours playing around to get a sense of how much we can push towards SIP-34's look & feel with limited effort.

BEFORE

Screen Shot 2020-06-16 at 12 03 10 AM

AFTER

Screen Shot 2020-06-16 at 12 02 40 AM

Screen Shot 2020-06-16 at 9 49 46 PM

Screen Shot 2020-06-16 at 9 48 05 PM

TODO

  • colors went in smoothly, though we need a new Superset logo with the new @brand-primary color!
  • text on btn-sm isn't aligned, the new font we use isn't aligned with the pixels it reserves
  • SIP-34 primary and secondary buttons don't look good in button groups where it's unclear where one button and the next starts. I think we'll be moving away from using btn-group and have buttons side by side (with a gap) and the extra buttons into dropdowns - but this requires touching layouts (not just CSS). Bootstrap offers btn-primary and btn-default, but no tierciary. For now I rolled with using what SIP-34 defines as tierciary on btn-default to work around the group issue
  • SQL Lab tab headers are buttons but shouldn't be, as a result they got uppercased. We need to get them out of buttons

@codecov-commenter
Copy link

codecov-commenter commented Jun 15, 2020

Codecov Report

Merging #10056 into master will decrease coverage by 4.69%.
The diff coverage is 58.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10056      +/-   ##
==========================================
- Coverage   70.49%   65.79%   -4.70%     
==========================================
  Files         585      586       +1     
  Lines       31074    31114      +40     
  Branches     3185     3197      +12     
==========================================
- Hits        21905    20472    -1433     
- Misses       9060    10464    +1404     
- Partials      109      178      +69     
Flag Coverage Δ
#cypress ?
#javascript 59.73% <58.33%> (+0.24%) ⬆️
#python 70.10% <ø> (+0.02%) ⬆️
Impacted Files Coverage Δ
...erset-frontend/src/SqlLab/components/SaveQuery.jsx 77.77% <ø> (ø)
...rontend/src/SqlLab/components/ShareSqlLabQuery.jsx 93.54% <ø> (ø)
...erset-frontend/src/SqlLab/components/SqlEditor.jsx 52.56% <ø> (-2.57%) ⬇️
...frontend/src/components/ListView/LegacyFilters.tsx 75.00% <ø> (ø)
...rset-frontend/src/components/ListView/ListView.tsx 98.03% <ø> (ø)
...ontend/src/explore/components/QueryAndSaveBtns.jsx 70.00% <0.00%> (-20.00%) ⬇️
...rontend/src/SqlLab/components/TabbedSqlEditors.jsx 73.46% <60.00%> (-8.35%) ⬇️
...end/src/SqlLab/components/RunQueryActionButton.tsx 71.42% <100.00%> (ø)
superset-frontend/src/SqlLab/App.jsx 0.00% <0.00%> (-100.00%) ⬇️
superset-frontend/src/explore/App.jsx 0.00% <0.00%> (-100.00%) ⬇️
... and 157 more

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 280ade8...288099b. Read the comment docs.

@pull-request-size pull-request-size bot added size/L and removed size/M labels Jun 16, 2020
@mistercrunch mistercrunch changed the title [WiP] feat: push bootstrap theme towards SIP-34 styles style: push bootstrap theme towards SIP-34 styles Jun 16, 2020
@mistercrunch mistercrunch marked this pull request as ready for review June 16, 2020 07:12
@etr2460
Copy link
Member

etr2460 commented Jun 16, 2020

I don't want to rain on this parade too much, but I noticed that the tab titles were a bit hard to read on the gray background. After double checking, it seems like the brand primary color isn't accessible when used on the gray background (https://webaim.org/resources/contrastchecker/?fcolor=20A7C9&bcolor=F5F5F5). Did the SIP-34 designs solve for this? If so, we should probably add that part of the designs into this PR too so we don't regress a11y
image

@mistercrunch
Copy link
Member Author

@etr2460 good catch, bolded it here ->
Screen Shot 2020-06-16 at 9 37 45 AM

@ktmud
Copy link
Member

ktmud commented Jun 16, 2020

The bolded text still fails the contrast checker according to Erik’s screenshot. Can we keep all text with white/gray background black and change only the high-contrast primary button?

I don’t remember seeing this color in light background in SIP-34.

@etr2460
Copy link
Member

etr2460 commented Jun 16, 2020

@mistercrunch do you think that bolding it is enough? According to the contrast checker, even larger, bolded text with these colors fail accessibility guidelines. Note that to pass the AA check for large text, the contrast ratio must be at least 3:1

@mistercrunch
Copy link
Member Author

Screen Shot 2020-06-16 at 10 38 33 AM

Copy link
Member

@etr2460 etr2460 left a comment

Choose a reason for hiding this comment

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

looks like linters are failing, try running npm run lint-fix

* specific language governing permissions and limitations
* under the License.
*/
.save-btn {
Copy link
Member

Choose a reason for hiding this comment

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

should we be using a styled component here? @rusackas

@@ -66,9 +66,14 @@

// Buttons ====================================================================

.btn {
Copy link
Member

Choose a reason for hiding this comment

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

this will change buttons everywhere right? Can we see other screenshots of the ui in addition to SQL Lab?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes let me take a few screenshots

@mistercrunch mistercrunch force-pushed the cartel branch 5 times, most recently from 4d7df7d to 0f40ce3 Compare June 17, 2020 14:07
@ktmud
Copy link
Member

ktmud commented Jun 17, 2020

There are still a couple of places that have the light blue in light background, most noticeably the btn-default and text links. I think SIP-34 design mostly used what it calls "SECONDARY" buttons in replacement of the btn-default from Bootstrap.

I updated the CSS a little so hopefully it made things a little bit better:

Snip20200617_36

image

image

Would be nice if there're design mockups for the intermediate state between current Superset and SIP-34 so we could have a better idea how to replace different elements with a11y in mind.

@mistercrunch
Copy link
Member Author

@ktmud thanks for the feedback, yeah the reason I used what SIP-34 calls "button tertiary" instead of "button secondary" is because we currently use a lot of btn-group, and the borderless "button secondary" didn't look super good (but may be ok, idk). I thought I'd use tertiary for now until we break down the buttons into less buttons and hamburgers btn-dropdown...

Happy to go either way. Clearly this is just the first of many PRs in that general SIP-34 theme direction.

Thoughts?

@mistercrunch
Copy link
Member Author

mistercrunch commented Jun 17, 2020

Coupling this PR where we change the logo to use our new primary brand color. #10090 , we should merge the two at ~the same time.

@mistercrunch
Copy link
Member Author

Also note that our primary color should be ok on white (or is it not?). It was bad against a grey but should be ok on white. It's our link color too btw.

@ktmud
Copy link
Member

ktmud commented Jun 17, 2020

Also note that our primary color should be ok on white (or is it not?). It was bad against a grey but should be ok on white. It's our link color too btw.

The text color on that "tertiary" button is actually darker than the primary brand color (I used screen color pickers). Kind of feel the colors listed in UI Colors is just for visuals, not really of any practical purposes (the hex codes are also different than the actual colors beneath it).

@ktmud
Copy link
Member

ktmud commented Jun 17, 2020

If this is not blocking anything, I'd recommend asking for some designers' help to get properly annotated colors (text/background/border for buttons, links, hover/active/focus state, etc, in the context of current Superset design), or putting things in a feature branch to hammer the details out (e.g., workarounds for button groups).

@mistercrunch
Copy link
Member Author

mistercrunch commented Jun 17, 2020

the hex codes are also different than the actual colors beneath it

I noticed that and used the colors, not the hex

A bigger question is how we roll this out. I'm not against maturing this in a feature branch, but I think this is better than what we have now. I'm pretty sure the current colors are Airbnb's kazan/beach/raush, ... I really feel like it's overdue to move away from that and onto the SIP-34 palette.

What's the proper merge point?

@ktmud
Copy link
Member

ktmud commented Jun 18, 2020

What's the proper merge point?

I also like the new colors. Just felt having a11y regression or two noticeably incompatible styles is worse than having an outdated style.

How about we reduce the scope of this PR a little to only change the primary color from kazan to cartel blue + darker blue for text and leave btn-default and others untouched?

@mistercrunch
Copy link
Member Author

I also like the new colors. Just felt having a11y regression or two noticeably incompatible styles is worse than having an outdated style.

agreed

How about we reduce the scope of this PR a little to only change the primary color from kazan to cartel blue + darker blue for text and leave btn-default and others untouched?

rolling back btn-default changes to keep the previous gray tone one, but I'd like to move forward with everything else in here though

@mistercrunch
Copy link
Member Author

I doubled checked in Figma and found that links are actually darker than buttons, specified that darker blue in the theme.

@mistercrunch
Copy link
Member Author

mistercrunch commented Jun 18, 2020

Screen Shot 2020-06-17 at 7 51 38 PM

Screen Shot 2020-06-17 at 7 51 15 PM

Screen Shot 2020-06-17 at 7 50 54 PM

Screen Shot 2020-06-17 at 7 50 35 PM

Copy link
Member

@ktmud ktmud left a comment

Choose a reason for hiding this comment

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

Looks good!


In my previous link, I also updated the info box in my branch

image

to make it more in line with the Cartel design:

image

image

Could you slip this in as well? Or feel free to do it in another PR.

@mistercrunch
Copy link
Member Author

Let's go little by little, I prefer seeing a storm of small style: PRs in that general direction

@mistercrunch mistercrunch merged commit a6390af into apache:master Jun 18, 2020
@@ -66,6 +66,10 @@

// Buttons ====================================================================

.btn {
text-transform: uppercase;
Copy link
Member

Choose a reason for hiding this comment

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

Note: this also transforms datasource names in chart control panel:

which is probably not what we want.

@rusackas rusackas deleted the cartel branch July 9, 2020 16:59
auxten pushed a commit to auxten/incubator-superset that referenced this pull request Nov 20, 2020
* feat: cartel theme

* piling

* more tweaks

* Make things look better

* lint

* fix tests

* paint it black

* tweaks
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.37.0 labels Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/L 🚢 0.37.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants