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

Add named colors, polish HTML editor #354

Merged
merged 5 commits into from
Mar 30, 2017
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 33 additions & 2 deletions editor/assets/stylesheets/variables.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,37 @@
$gray: #575D65;
$light-gray: #e0e5e9;
/* Hugo's new WordPress shades of gray, from http://codepen.io/hugobaeta/pen/grJjVp */
$black: #000;
$dark-gray-900: #191e23;
$dark-gray-800: #23282d;
$dark-gray-700: #32373c;
$dark-gray-600: #40464d;
$dark-gray-500: #555d66; // use this most of the time for dark items
$dark-gray-400: #606a73;
$dark-gray-300: #6c7781;
$dark-gray-200: #7e8993;
$dark-gray-100: #8f98a1;
$light-gray-900: #a2aab2;
$light-gray-800: #b5bcc2;
$light-gray-700: #ccd0d4;
$light-gray-600: #d7dade;
$light-gray-500: #e2e4e7; // good for "grayed" items and borders
$light-gray-400: #e8eaeb;
$light-gray-300: #edeff0;
$light-gray-200: #f3f4f5;
$light-gray-100: #f8f9f9;
$white: #fff;

/* Extra colors, some from https://make.wordpress.org/design/handbook/foundations/colors/ */
$blue-wordpress-700: #00669b;
$blue-wordpress: #0073aa;

$blue-medium: #00a0d2;
$blue-medium-400: #33B3DB;
$blue-medium-300: #66C6E4;
$blue-medium-200: #BFE7F3;
$blue-medium-100: #E5F5FA;

/* Other */
$editor-font: "Noto Serif", serif;
$editor-html-font: "Meno", monospace;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this font loaded by default in WordPress? or should we load it in index.php like the "Noto" font?

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 expect this font stack to grow further — Menlo is an OSX bundled system font. I will return with a better font stack later, but I don't think we should load any fonts separately.

Copy link
Contributor

Choose a reason for hiding this comment

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

Is it "Menlo" or "Meno"?

So, you're saying we keep those as is temporary and we'll include them in the Repo later? I'm not sure I understand your point :P.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Facepalm. It was Menlo. My apologies.

So, you're saying we keep those as is temporary and we'll include them in the Repo later?

Are you referring to a webfont or just a font stack that picks from fonts available on your system?

I expanded the monospaced font stack so it's not temporary. Or rather, it's temporary insofar as I expect that we will probably revisit this in the future as I feel like there's a history here. But no webfonts are being loaded — we are just using fonts that you are likely to have on your system.

$editor-font-size: 16px;
$editor-line-height: 1.8em;
32 changes: 26 additions & 6 deletions editor/editor/style.scss
Original file line number Diff line number Diff line change
@@ -1,20 +1,34 @@
/**
* Editor Styles
*/

* {
box-sizing: border-box;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This is already added here https://github.com/WordPress/gutenberg/blob/add/polish/editor/assets/stylesheets/main.scss#L19 and it's relative to the editor only to avoid altering any other WordPress style (sidebar etc...)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, good catch, still finding my way here.



/**
* General Layout
*/

.editor__header {
height: 56px;
padding: 10px;
border-bottom: 1px solid $light-gray;
border-bottom: 1px solid $light-gray-500;
}

.editor-mode-switcher {
position: relative;
}

.editor-mode-switcher__toggle {
color: $gray;
color: $dark-gray-500;
padding: 8px;
align-items: center;
cursor: pointer;
border: none;
background: none;
border-right: 1px solid $light-gray;
border-right: 1px solid $light-gray-500;
vertical-align: middle;
line-height: 20px;
outline: none;
Expand All @@ -23,8 +37,8 @@
.editor-mode-switcher__content {
position: absolute;
top: 40px;
border: 1px solid $light-gray;
color: $gray;
border: 1px solid $light-gray-500;
color: $dark-gray-500;
min-width: 100px;

button {
Expand All @@ -39,7 +53,7 @@
}

.editor-mode-switcher__arrow {
border: 10px dashed $light-gray;
border: 10px dashed $light-gray-500;
height: 0;
line-height: 0;
position: absolute;
Expand Down Expand Up @@ -79,6 +93,7 @@
resize: none;
padding: 0;
overflow: hidden;
font-family: $editor-html-font;
}
}

Expand All @@ -97,3 +112,8 @@
}
}
}

/* Hide footer */
#wpfooter {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we move this to the global stylesheet main.scss.

Should we add it under the .toplevel_page_gutenberg like other WP style tweaks (to avoid altering these style in other pages, if ever the editor style is mixed with all the WPAdmin stylesheets) https://github.com/WordPress/gutenberg/blob/add/polish/editor/assets/stylesheets/main.scss#L5

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep. Perfect.

display: none;
}
10 changes: 5 additions & 5 deletions editor/inserter/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@

.inserter__button-toggle {
display: inline-block;
color: $gray;
color: $dark-gray-500;
background: none;
cursor: pointer;
border-radius: 50%;
border: 2px solid $gray;
border: 2px solid $dark-gray-500;
width: 26px;
height: 26px;
padding: 0;
Expand All @@ -35,15 +35,15 @@
.inserter {
width: 280px;
box-shadow: 0px 3px 20px rgba( 18, 24, 30, .1 ), 0px 1px 3px rgba( 18, 24, 30, .1 );
border: 1px solid $light-gray;
border: 1px solid $light-gray-500;
position: absolute;
left: -127px;
bottom: 42px;
background: #fff;
}

.inserter__arrow {
border: 10px dashed $light-gray;
border: 10px dashed $light-gray-500;
height: 0;
line-height: 0;
position: absolute;
Expand Down Expand Up @@ -85,7 +85,7 @@
width: 100%;
border: none;
margin: 0;
border-top: 1px solid $light-gray;
border-top: 1px solid $light-gray-500;
padding: 8px 16px;
font-size: 13px;

Expand Down