-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor. Add global styles for heading and quote
- Loading branch information
Jon Q
committed
Feb 7, 2020
1 parent
e291e15
commit a7c32cc
Showing
13 changed files
with
421 additions
and
235 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 |
---|---|---|
|
@@ -17,3 +17,9 @@ | |
} | ||
} | ||
} | ||
|
||
.wp-gs .wp-block-quote { | ||
p { | ||
font-size: var(--wp-quote--fontSize); | ||
} | ||
} |
224 changes: 0 additions & 224 deletions
224
packages/edit-site/src/components/sidebar/global-styles-panel.js
This file was deleted.
Oops, something went wrong.
31 changes: 31 additions & 0 deletions
31
packages/edit-site/src/components/sidebar/global-styles-panel/index.js
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,31 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { __ } from '@wordpress/i18n'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import { GlobalStylesStateProvider } from './store'; | ||
|
||
import { Panel } from '@wordpress/components'; | ||
|
||
import { | ||
ColorPanel, | ||
HeadingPanel, | ||
QuotePanel, | ||
TypographyPanel, | ||
} from './panels'; | ||
|
||
export default function GlobalStylesPanel() { | ||
return ( | ||
<GlobalStylesStateProvider> | ||
<Panel header={ __( 'Global Styles' ) }> | ||
<TypographyPanel /> | ||
<ColorPanel /> | ||
<HeadingPanel /> | ||
<QuotePanel /> | ||
</Panel> | ||
</GlobalStylesStateProvider> | ||
); | ||
} |
41 changes: 41 additions & 0 deletions
41
packages/edit-site/src/components/sidebar/global-styles-panel/panels/color-panel.js
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,41 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { __ } from '@wordpress/i18n'; | ||
import { PanelBody, ColorControl } from '@wordpress/components'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import { useGlobalStylesState } from '../store'; | ||
|
||
export default function ColorsPanel() { | ||
const { | ||
textColor, | ||
setTextColor, | ||
backgroundColor, | ||
setBackgroundColor, | ||
primaryColor, | ||
setPrimaryColor, | ||
} = useGlobalStylesState(); | ||
|
||
return ( | ||
<PanelBody title={ __( 'Colors' ) } initialOpen={ false }> | ||
<ColorControl | ||
label={ __( 'Text' ) } | ||
value={ textColor } | ||
onChange={ setTextColor } | ||
/> | ||
<ColorControl | ||
label={ __( 'Background' ) } | ||
value={ backgroundColor } | ||
onChange={ setBackgroundColor } | ||
/> | ||
<ColorControl | ||
label={ __( 'Primary' ) } | ||
value={ primaryColor } | ||
onChange={ setPrimaryColor } | ||
/> | ||
</PanelBody> | ||
); | ||
} |
Oops, something went wrong.