Skip to content

Add theme support for custom palettes and shared "ColorPalette" component#2186

Merged
mtias merged 5 commits intomasterfrom
add/theme-support-for-palettes
Aug 3, 2017
Merged

Add theme support for custom palettes and shared "ColorPalette" component#2186
mtias merged 5 commits intomasterfrom
add/theme-support-for-palettes

Conversation

@mtias
Copy link
Copy Markdown
Member

@mtias mtias commented Aug 3, 2017

image

Done via:

add_theme_support( 'gutenberg', array(
	'colors' => array(
		'#A156B4',
		'#D0A5DB',
		'#EEE',
		'#444',
	),
) );

@mtias mtias added [Feature] Block API API that allows to express the block paradigm. [Feature] Blocks Overall functionality of blocks Gutenberg Plugin Issues or PRs related to Gutenberg Plugin management related efforts labels Aug 3, 2017
@mtias mtias changed the title Add/theme support for palettes Add theme support for custom palettes and shared "ColorPalette" component Aug 3, 2017
Copy link
Copy Markdown
Member

@karmatosed karmatosed left a comment

Choose a reason for hiding this comment

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

This looks really good. My only thought would be can somehow it be indicated the order the colors appear? I know it doesn't matter but for some it will visually matter, maybe just a comment in code?

@mtias
Copy link
Copy Markdown
Member Author

mtias commented Aug 3, 2017

The order would be the order in the array. Do you mean to clarify that?

@karmatosed
Copy link
Copy Markdown
Member

@mtias yes I think clarifying it is good, perhaps just a code comment though.

@codecov
Copy link
Copy Markdown

codecov bot commented Aug 3, 2017

Codecov Report

Merging #2186 into master will decrease coverage by 0.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2186      +/-   ##
==========================================
- Coverage    22.3%   22.29%   -0.02%     
==========================================
  Files         137      138       +1     
  Lines        4291     4293       +2     
  Branches      722      722              
==========================================
  Hits          957      957              
- Misses       2815     2817       +2     
  Partials      519      519
Impacted Files Coverage Δ
blocks/color-palette/index.js 0% <0%> (ø)
blocks/library/button/index.js 26.66% <0%> (ø) ⬆️
blocks/library/cover-text/index.js 31.57% <0%> (+1.57%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a1b1886...35f3258. Read the comment docs.

Copy link
Copy Markdown
Contributor

@melchoyce melchoyce left a comment

Choose a reason for hiding this comment

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

Great idea, seems easy for themers to implement. 👍

Any way we could also have it support Sass color variables somehow?

Copy link
Copy Markdown
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

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

Awesome feature, code looks good.

Looks like there's a small phpcs error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] Block API API that allows to express the block paradigm. [Feature] Blocks Overall functionality of blocks Gutenberg Plugin Issues or PRs related to Gutenberg Plugin management related efforts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants