Skip to content

Commit

Permalink
Update gutenberg block styles
Browse files Browse the repository at this point in the history
  • Loading branch information
aristath committed May 11, 2019
1 parent c2b7b4d commit b3835ac
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 20 deletions.
2 changes: 2 additions & 0 deletions assets/css/blocks/block-library/_colors.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ $dark-opacity-light-400: rgba(#95959c, 0.2);
$dark-opacity-light-300: rgba(#829493, 0.15);
$dark-opacity-light-200: rgba(#8b8b96, 0.1);
$dark-opacity-light-100: rgba(#747474, 0.05);
$dark-opacity-background-fill: rgba($dark-gray-700, 0.7); // Similar to $dark-opacity-light-200, but more opaque.

// Light opacities, for use with dark themes.
$light-opacity-900: rgba($white, 1);
Expand All @@ -64,6 +65,7 @@ $light-opacity-light-400: rgba($white, 0.25);
$light-opacity-light-300: rgba($white, 0.2);
$light-opacity-light-200: rgba($white, 0.15);
$light-opacity-light-100: rgba($white, 0.1);
$light-opacity-background-fill: rgba($light-gray-300, 0.8); // Similar to $light-opacity-light-200, but more opaque.

// Additional colors.
// Some are from https://make.wordpress.org/design/handbook/foundations/colors/.
Expand Down
4 changes: 2 additions & 2 deletions assets/css/blocks/block-library/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@

@mixin input-style__focus() {
color: $dark-gray-900;
border-color: $blue-medium-500;
box-shadow: 0 0 0 1px $blue-medium-500;
border-color: $blue-medium-focus;
box-shadow: 0 0 0 1px $blue-medium-focus;

// Windows High Contrast mode will show this outline, but not the box-shadow.
outline: 2px solid transparent;
Expand Down
5 changes: 3 additions & 2 deletions assets/css/blocks/block-library/latest-posts/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@
/*rtl:ignore*/
margin-left: 2em;
}
&.wp-block-latest-posts__list {
list-style: none;
}
&.is-grid {
display: flex;
flex-wrap: wrap;
padding: 0;
list-style: none;

li {
margin: 0 16px 16px 0;
Expand All @@ -33,4 +35,3 @@
color: $dark-gray-300;
font-size: $default-font-size;
}

2 changes: 1 addition & 1 deletion assets/css/blocks/block-library/media-text/style.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

.wp-block-media-text {
display: grid;
grid-template-rows: auto;
align-items: center;
grid-template-areas: "media-text-media media-text-content";
grid-template-columns: 50% auto;

&.has-media-on-the-right {
grid-template-areas: "media-text-content media-text-media";
grid-template-columns: auto 50%;
Expand Down
4 changes: 2 additions & 2 deletions assets/css/blocks/block-library/readme.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
This folder contains styles for editor blocks.
These styles were copied from the Gutenberg project, and then tweaked to remove duplicates and optimize them for use in the Gridd theme.

Blocks styles copied from https://github.com/WordPress/gutenberg/tree/7c1811268d47181b5a4d77497706ddeb948f6cd1/packages/block-library/src
Variables, mixins etc copied from https://github.com/WordPress/gutenberg/tree/7c1811268d47181b5a4d77497706ddeb948f6cd1/assets/stylesheets
Blocks styles copied from https://github.com/WordPress/gutenberg/tree/4108e37d3771b5871cd720216432b5bbd5255551/packages/block-library/src
Variables, mixins etc copied from https://github.com/WordPress/gutenberg/tree/4108e37d3771b5871cd720216432b5bbd5255551/assets/stylesheets
11 changes: 6 additions & 5 deletions assets/css/blocks/block-library/table/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -45,34 +45,35 @@
border-collapse: inherit;
background-color: transparent;

tr:nth-child(odd) {
tbody tr:nth-child(odd) {
background-color: $light-gray-200;
}

&.has-subtle-light-gray-background-color {
tr:nth-child(odd) {
tbody tr:nth-child(odd) {
background-color: $subtle-light-gray;
}
}

&.has-subtle-pale-green-background-color {
tr:nth-child(odd) {
tbody tr:nth-child(odd) {
background-color: $subtle-pale-green;
}
}

&.has-subtle-pale-blue-background-color {
tr:nth-child(odd) {
tbody tr:nth-child(odd) {
background-color: $subtle-pale-blue;
}
}

&.has-subtle-pale-pink-background-color {
tr:nth-child(odd) {
tbody tr:nth-child(odd) {
background-color: $subtle-pale-pink;
}
}

th,
td {
border-color: transparent;
}
Expand Down
4 changes: 3 additions & 1 deletion assets/css/blocks/latest-posts.css
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,13 @@
/*rtl:ignore*/
margin-left: 2em;
}
.wp-block-latest-posts.wp-block-latest-posts__list {
list-style: none;
}
.wp-block-latest-posts.is-grid {
display: flex;
flex-wrap: wrap;
padding: 0;
list-style: none;
}
.wp-block-latest-posts.is-grid li {
margin: 0 16px 16px 0;
Expand Down
2 changes: 1 addition & 1 deletion assets/css/blocks/latest-posts.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions assets/css/blocks/table.css
Original file line number Diff line number Diff line change
Expand Up @@ -95,21 +95,22 @@
background-color: transparent;
border-bottom: 1px solid #f3f4f5;
}
.wp-block-table.is-style-stripes tr:nth-child(odd) {
.wp-block-table.is-style-stripes tbody tr:nth-child(odd) {
background-color: #f3f4f5;
}
.wp-block-table.is-style-stripes.has-subtle-light-gray-background-color tr:nth-child(odd) {
.wp-block-table.is-style-stripes.has-subtle-light-gray-background-color tbody tr:nth-child(odd) {
background-color: #f3f4f5;
}
.wp-block-table.is-style-stripes.has-subtle-pale-green-background-color tr:nth-child(odd) {
.wp-block-table.is-style-stripes.has-subtle-pale-green-background-color tbody tr:nth-child(odd) {
background-color: #e9fbe5;
}
.wp-block-table.is-style-stripes.has-subtle-pale-blue-background-color tr:nth-child(odd) {
.wp-block-table.is-style-stripes.has-subtle-pale-blue-background-color tbody tr:nth-child(odd) {
background-color: #e7f5fe;
}
.wp-block-table.is-style-stripes.has-subtle-pale-pink-background-color tr:nth-child(odd) {
.wp-block-table.is-style-stripes.has-subtle-pale-pink-background-color tbody tr:nth-child(odd) {
background-color: #fcf0ef;
}
.wp-block-table.is-style-stripes th,
.wp-block-table.is-style-stripes td {
border-color: transparent;
}
Expand Down
2 changes: 1 addition & 1 deletion assets/css/blocks/table.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b3835ac

Please sign in to comment.