This repository has been archived by the owner on Sep 16, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 863
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1331 from derweili/gutenberg
Gutenberg Support
- Loading branch information
Showing
8 changed files
with
194 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
if ( ! function_exists( 'foundationpress_gutenberg_support' ) ) : | ||
function foundationpress_gutenberg_support() { | ||
|
||
// Add foundation color palette to the editor | ||
add_theme_support( 'editor-color-palette', array( | ||
array( | ||
'name' => __( 'Primary Color', 'foundationpress' ), | ||
'slug' => 'primary', | ||
'color' => '#1779ba', | ||
), | ||
array( | ||
'name' => __( 'Secondary Color', 'foundationpress' ), | ||
'slug' => 'secondary', | ||
'color' => '#767676', | ||
), | ||
array( | ||
'name' => __( 'Success Color', 'foundationpress' ), | ||
'slug' => 'success', | ||
'color' => '#3adb76', | ||
), | ||
array( | ||
'name' => __( 'Warning color', 'foundationpress' ), | ||
'slug' => 'warning', | ||
'color' => '#ffae00', | ||
), | ||
array( | ||
'name' => __( 'Alert color', 'foundationpress' ), | ||
'slug' => 'alert', | ||
'color' => '#cc4b37', | ||
) | ||
) ); | ||
|
||
} | ||
|
||
add_action( 'after_setup_theme', 'foundationpress_gutenberg_support' ); | ||
endif; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
/*! | ||
* Gutenberg Editor Styles | ||
*/ | ||
|
||
/** === Includes === */ | ||
|
||
@charset 'utf-8'; | ||
|
||
@import 'settings'; | ||
@import 'foundation'; | ||
|
||
@include foundation-typography; | ||
@include foundation-button; | ||
@include foundation-table; | ||
|
||
|
||
/** === Content Width === */ | ||
.wp-block { | ||
width: calc(100vw - (2 * 10)); | ||
@each $breakpoint, $size in $grid-margin-gutters { | ||
|
||
@include breakpoint($breakpoint) { | ||
width: calc(100vw - ($size)); | ||
} | ||
|
||
} | ||
} | ||
|
||
/** === Base Typography === */ | ||
body { | ||
font-size: $global-font-size; | ||
font-family: $body-font-family; | ||
color: $body-font-color; | ||
} | ||
|
||
/** === Post Title === */ | ||
.editor-post-title__block .editor-post-title__input{ | ||
@extend h1; | ||
} | ||
|
||
/** === Button === */ | ||
.wp-block-button { | ||
|
||
// add general foundation button styling to button in editor | ||
.wp-block-button__link { | ||
@extend .button; | ||
} | ||
|
||
// add special styling for squared buttons | ||
&.is-style-squared .wp-block-button__link { | ||
border-radius: 0; | ||
} | ||
|
||
// add outline styles | ||
&.is-style-outline .wp-block-button__link{ | ||
@extend .hollow; | ||
} | ||
|
||
// set transparent background to block for outline button | ||
&.is-style-outline, | ||
&.is-style-outline:hover, | ||
&.is-style-outline:focus, | ||
&.is-style-outline:active { | ||
background: transparent; | ||
} | ||
} | ||
|
||
/** === File === */ | ||
.wp-block-file__button{ | ||
@include button(); | ||
} | ||
|
||
/** === Pullquote === */ | ||
.wp-block-paragraph.has-background{ | ||
padding: rem-calc(20px 30px); | ||
} | ||
|
||
/** === Table === */ | ||
.wp-block-table td{ | ||
border: none; | ||
} | ||
|
||
/** === Latest Posts grid view === */ | ||
.wp-block-latest-posts.is-grid{ | ||
list-style: none; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
Frontend styles for gutenberg blocks | ||
*/ | ||
|
||
/** === Base Color Palatte === */ | ||
@each $color, $code in $foundation-palette { | ||
|
||
.has-#{$color}-background-color { | ||
background-color: $code; | ||
} | ||
|
||
.has-#{$color}-color { | ||
color: $code; | ||
} | ||
} | ||
|
||
/** === Button === */ | ||
.wp-block-button { | ||
|
||
// add general foundation button styling | ||
.wp-block-button__link { | ||
@extend .button; | ||
@each $color, $code in $foundation-palette { | ||
|
||
&.has-#{$color}-background-color { | ||
background-color: $code; | ||
} | ||
|
||
&.has-#{$color}-color { | ||
color: $code; | ||
} | ||
} | ||
} | ||
|
||
// add special styling for squared buttons | ||
&.is-style-squared .wp-block-button__link { | ||
border-radius: 0; | ||
} | ||
|
||
// add outline styles | ||
&.is-style-outline .wp-block-button__link{ | ||
@extend .hollow; | ||
} | ||
|
||
// set transparent background to block for outline button | ||
&.is-style-outline, | ||
&.is-style-outline:hover, | ||
&.is-style-outline:focus, | ||
&.is-style-outline:active { | ||
// background: transparent; | ||
.wp-block-button__link{ | ||
// background: transparent; | ||
} | ||
} | ||
} | ||
|
||
/** === File === */ | ||
.wp-block-file .wp-block-file__button{ | ||
@include button(); | ||
} |