Skip to content
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

Use colors from available_colors #59

Merged
merged 4 commits into from
Aug 4, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 0 additions & 36 deletions src/StyleWrapper/EEAColorscheme.js

This file was deleted.

8 changes: 4 additions & 4 deletions src/StyleWrapper/schema.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import colorscheme from './EEAColorscheme';
import config from '@plone/volto/registry';

export const StyleSchema = () => {
return {
Expand Down Expand Up @@ -138,13 +138,13 @@ export const StyleSchema = () => {
title: 'Background color',
type: 'color',
widget: 'style_simple_color',
available_colors: colorscheme,
available_colors: config.settings.available_colors,
},
textColor: {
title: 'Text color',
type: 'color',
widget: 'style_simple_color',
available_colors: colorscheme,
available_colors: config.settings.available_colors,
},
customClass: {
title: 'Custom CSS Class',
Expand Down Expand Up @@ -178,7 +178,7 @@ export const StyleSchema = () => {
title: 'Shadow color',
type: 'color',
widget: 'style_simple_color',
available_colors: colorscheme,
available_colors: config.settings.available_colors,
},
borderRadius: {
widget: 'slider',
Expand Down
35 changes: 35 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,41 @@ const applyConfig = (config) => {
config.settings.layoutOnlyBlockStyles = false;
}

config.settings.available_colors = [
'#bbdbec',
'#9dc6d4',
'#5a93aa',
'#005d7b',
'#003d53',
'#ebefc6',
'#bdd494',
'#6bb535',
'#1e8339',
'#025e37',
'#464b0b',
'#b5c234',
'#777b1a',
'#f4f1bc',
'#e1e070',
'#0070ae',
'#fce6dc',
'#f39a86',
'#e73d5c',
'#b92f47',
'#8e1206',
'#fff6a6',
'#ffe525',
'#f7a600',
'#b94b19',
'#8d4107',
'#000000',
'#6f6f6e',
'#929291',
'#bcbcbc',
'#e3e3e3',
'#ffffff',
];

return config;
};

Expand Down