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 theme support for custom palettes and shared "ColorPalette" component #2186

Merged
merged 5 commits into from Aug 3, 2017

Conversation

Projects
None yet
4 participants
@mtias
Contributor

mtias commented Aug 3, 2017

image

Done via:

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

@mtias mtias changed the title from Add/theme support for palettes to Add theme support for custom palettes and shared "ColorPalette" component Aug 3, 2017

@karmatosed

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

This comment has been minimized.

Show comment
Hide comment
@mtias

mtias Aug 3, 2017

Contributor

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

Contributor

mtias commented Aug 3, 2017

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

@karmatosed

This comment has been minimized.

Show comment
Hide comment
@karmatosed

karmatosed Aug 3, 2017

Member

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

Member

karmatosed commented Aug 3, 2017

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

@codecov

This comment has been minimized.

Show comment
Hide comment
@codecov

codecov bot 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.

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.

@melchoyce

Great idea, seems easy for themers to implement. 👍

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

@youknowriad

Awesome feature, code looks good.

Looks like there's a small phpcs error

@mtias mtias merged commit d8bf7d0 into master Aug 3, 2017

3 checks passed

codecov/project 22.29% (-0.02%) compared to a1b1886
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@mtias mtias deleted the add/theme-support-for-palettes branch Aug 3, 2017

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