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

Sidebar styling tweaks #703

Merged
merged 25 commits into from
Oct 1, 2018
Merged

Sidebar styling tweaks #703

merged 25 commits into from
Oct 1, 2018

Conversation

dutchmartin
Copy link
Contributor

@dutchmartin dutchmartin commented Aug 9, 2018

Summary

This PR can be summarized in the following changelog entry:

  • Changed the border color of the Collapsible component to #e2e4e7.
  • Changed the text color of the Collapsibles within the ContentAnalysis component to $color_headings (#555) and remove the bold font-weight.
  • Removed the max-width from the ContentAnalysis component to remove the wrapping of the analysis results on big screens
  • Added a dropshadow to the YoastInputField component.

Relevant technical choices:

  • Adding a color in the colors.json.

Test instructions

This PR can be tested by following these steps:

  • Checkout this branch and link it into wordpress seo.
  • Go to a post.
  • Verify the following things:
    • The dividers between the sidebar sections have the same color as Gutenberg uses, i.e. #e2e4e7.
    • The titles within the analysis have the same font color as the analysis descriptions and are not bold.
    • All our input fields in the sidebar and metabox (keywords, synonyms, additional focus keyword, snippet editor title, snippet editor description) have the same blue border on focus.
    • All keywords and synonyms inputs in the metabox and sidebar have the same height: 16 px.
    • The analysis component doesn't have a max-width from, meaning the analysis results no longer wrap on bigger screens.

Fixes Yoast/wordpress-seo#10596

Copy link
Contributor

@IreneStr IreneStr left a comment

Choose a reason for hiding this comment

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

CR done: 1 minor comment. Also, please solve the merge conflicts.

@@ -65,6 +66,7 @@ const StyledTitle = styled.span`
white-space: nowrap;
text-overflow: ellipsis;
overflow-x: hidden;
color: ${ colors.$palette_grey_dark };
Copy link
Contributor

Choose a reason for hiding this comment

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

Please never use a $palette_... color. Use $color_... instead. In this case: $color_headings

Copy link
Contributor

@Dieterrr Dieterrr left a comment

Choose a reason for hiding this comment

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

Please fix the travis builds that fail.
I don't think it's necessary to add a color to the style guide for this issue but if you think it is important make sure design approves.

@@ -2,6 +2,7 @@ $palette_white: #fff; // Safe to use with $palette_grey_text –
// Shades of gray from lighter to darker.
$palette_grey_ultra_light: #f7f7f7; // Safe to use with $palette_grey_text – $palette_black.
$palette_grey_light: #f1f1f1; // Safe to use with $palette_grey_text – $palette_black.
$palette_grey_medium_light: #e2e4e7;
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you discuss adding this color to the style guide with design? If not, please first make sure they are ok with it, otherwise use one of the existing colors from the style guide.

Copy link
Contributor

Choose a reason for hiding this comment

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

This has been discussed with @hedgefield and he was fine with it 😄 But good question to ask!

@IreneStr
Copy link
Contributor

Acceptance 🚧

  • You've introduced palette_grey_medium_light but are not using it. The dividers are still too light grey.
  • You've introduced an !important in the CSS. Please ask for help to find a different solution. @afercia might be your best bet. Only when nothing else seems to work, use!important.
  • The focus keyword input field in the sidebar is styled completely differently than the other input fields: they have rounded corners and the border is too dark.

For the next tester: don't forget to test the multiple keyword input fields in premium.

@IreneStr IreneStr assigned dutchmartin and unassigned dutchmartin Aug 29, 2018
@moorscode moorscode changed the title Fix the sidebar polishing issues Sidebar styling tweaks Sep 3, 2018
Copy link
Contributor

@jcomack jcomack left a comment

Choose a reason for hiding this comment

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

CR done 👍

border-top: 1px solid ${ colors.$palette_grey_light };
border-bottom: 1px solid ${ colors.$palette_grey_light };
border-top: 1px solid ${ colors.$palette_grey_medium_light };
border-bottom: 1px solid ${ colors.$palette_grey_medium_light };
Copy link
Contributor

Choose a reason for hiding this comment

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

please do not use $palette_* variables directly; their aliases should be used instead. I see an alias $color_border_gutenberg has been created, it should be used here.

padding: 0.75em;
font-size: 1em;
&&& {
box-shadow: inset 0 1px 2px rgba(0,0,0,.07);
Copy link
Contributor

Choose a reason for hiding this comment

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

from the style-guide readme:

do not use rgba colors in the palette, instead use the rgba() function

I'd agree the wording of this recommendation could be improved. However, it's meant to not introduce in the codebase colors that are not part of the palette. In this case it's a minor issue because it's black but for consistency I'd recommend to use ${ rgba( colors.$color_black, 0.7 ) }

&&& {
box-shadow: inset 0 1px 2px rgba(0,0,0,.07);
border: 1px solid ${ colors.$color_input_border };
padding: 0.75em;
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 this value is pre-existing, but it was discussed at some point because em values don't make much sense in this context and don't match our 8 pixels based grid size. Both in the standalone app and in Gutenberg the computed value is 9.75px which will also be subject to browsers rounding. I'd consider to use a different value, in pixels /Cc @hedgefield

box-shadow: inset 0 1px 2px rgba(0,0,0,.07);
border: 1px solid ${ colors.$color_input_border };
padding: 0.75em;
font-size: 13px;
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd keep it to 1em (which is equivalent to 13px in Gutenberg) unless there are specific reasons to use a value in pixels.

@afercia
Copy link
Contributor

afercia commented Sep 26, 2018

CR 🚧
See a few comments, mostly related to best practices.

@afercia
Copy link
Contributor

afercia commented Sep 28, 2018

Right now, this can't be tested on the plugin because:

  • the plugin trunk still has the getI18n error
  • the hotfix/8.3.1 branch that fixes the getI18n error has a wrong WPSEO_VERSION that prevents to build assets correctly
    to actually test it, either the first or the second need to be manually fixed temporarily

@@ -18,7 +19,11 @@ export const YoastInputLabel = styled.label`
`;

export const YoastInputField = styled.input`
border: 1px solid ${ colors.$color_input_border };
padding: 0.75em;
font-size: 1em;
Copy link
Contributor

Choose a reason for hiding this comment

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

These padding and font-size will now be overridden by Gutenberg in the sidebar. If we want the input fields in the sidebar to have the same size of the ones in the metabox, these should be moved within the block with higher specificity. Also, the padding is still 0.75em, as mentioned in a previous comment that computes to 9.75 pixels based on the font size usd in that context. A value in pixels would be preferable.

Current size difference between the input field in the metabox and in the sidebar:

screen shot 2018-10-01 at 09 59 13

&&& {
box-shadow: inset 0 1px 2px ${ rgba( colors.$color_black, 0.07 ) };
border: 1px solid ${ colors.$color_input_border };
border-radius: 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Noticed that setting box-shadow and border to a so high specificity prevents the focus style to work properly in the metabox. Instead in the sidebar the focus style is inherited by Gutenberg and it works.

@afercia
Copy link
Contributor

afercia commented Oct 1, 2018

CR 👍

Pushed a couple changes to:

  • set the input field padding to 8 pixels as per design feedback
  • fix the input field focus style

Will split the hardcoded colors in a separate issue.

When doing acceptance, please verify the fields (keyphrase, additional keyphrase, synonyms) have the same styling in the metabox and in the sidebar, including the focus style:

screen shot 2018-10-01 at 11 32 07

@IreneStr
Copy link
Contributor

IreneStr commented Oct 1, 2018

Acceptance done 🎉

  • The dividers between the sidebar sections should have the same color as Gutenberg uses, i.e. a darker grey.
  • The titles within the analysis should have the same font color as the analysis descriptions (= black/ very dark grey) and shouldn't be bold.
  • All input fields in the sidebar (keywords, synonyms, additional focus keyword (more?)) should have the same style as the input fields in the snippet editor. This means that at least a dropshadow should be added).
  • Remove the max-width from the analysis component to remove the wrapping of the analysis results on big screens.

@IreneStr IreneStr merged commit a3f623c into develop Oct 1, 2018
@IreneStr IreneStr deleted the 10596-sidebar-polishing branch October 1, 2018 12:08
@IreneStr IreneStr added this to the 4.13 milestone Oct 17, 2018
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.

None yet

7 participants