@@ -18,7 +18,7 @@ It is fully configurable in terms of colors, you could define the set of colors
1818## Showcase
1919
2020<div >
21- <deckgo-color>
21+ <deckgo-color style={{width: '240px'}} >
2222 <span slot="more">...</span>
2323 </deckgo-color>
2424</div >
@@ -77,6 +77,8 @@ The "Color Picker" Web Component could be integrated using the tag `<deckgo-colo
7777
7878The slot ` more ` is optional, moreover, the "more" action itself could be turned off.
7979
80+ The slot ` custom-label ` is optional and can be used to display another label than ` Custom ` when user selects a custom color.
81+
8082### Attributes
8183
8284This component offers the following options which could be set using attributes:
@@ -88,6 +90,7 @@ This component offers the following options which could be set using attributes:
8890| ` more ` | ` more ` | In case you would not like to offer the "more" options. | ` boolean ` | ` true ` |
8991| ` moreAlt ` | ` more-alt ` | An accessibility label for the "more action. | ` string ` | ` 'More' ` |
9092| ` palette ` | | The palette of color (see here under). | ` DeckdeckgoPalette[] ` | ` DEFAULT_PALETTE ` |
93+ | ` label ` | ` label ` | Display a label for the description of the selected color | ` boolean ` | ` true ` |
9194
9295#### Palette
9396
@@ -113,104 +116,114 @@ The default palette is the following:
113116
114117```
115118export const DEFAULT_PALETTE: DeckdeckgoPalette[] = [
116- {
117- color: {
118- hex: '#FF6900',
119- rgb: '255,105,0'
119+ {
120+ color: {
121+ hex: '#8ED1FC',
122+ rgb: '142,209,252',
123+ },
124+ alt: 'Light blue',
120125 },
121- alt: 'Orange'
122- },
123- {
124- color: {
125- hex: '#FCB900' ,
126- rgb : '252,185,0'
126+ {
127+ color: {
128+ hex: '#0693E3',
129+ rgb: '6,147,227',
130+ } ,
131+ alt : 'Blue',
127132 },
128- alt: 'Yellow'
129- },
130- {
131- color: {
132- hex: '#7BDCB5' ,
133- rgb : '123,220,181'
133+ {
134+ color: {
135+ hex: '#7BDCB5',
136+ rgb: '123,220,181',
137+ } ,
138+ alt : 'Light green',
134139 },
135- alt: 'Light green'
136- },
137- {
138- color: {
139- hex: '#00D084' ,
140- rgb : '0,208,132'
140+ {
141+ color: {
142+ hex: '#00D084',
143+ rgb: '0,208,132',
144+ } ,
145+ alt : 'Green',
141146 },
142- alt: 'Green'
143- },
144- {
145- color: {
146- hex: '#8ED1FC' ,
147- rgb : '142,209,252'
147+ {
148+ color: {
149+ hex: '#FCB900',
150+ rgb: '252,185,0',
151+ } ,
152+ alt : 'Yellow',
148153 },
149- alt: 'Light blue'
150- },
151- {
152- color: {
153- hex: '#0693E3' ,
154- rgb : '6,147,227'
154+ {
155+ color: {
156+ hex: '#FF6900',
157+ rgb: '255,105,0',
158+ } ,
159+ alt : 'Orange',
155160 },
156- alt: 'Blue'
157- },
158- {
159- color: {
160- hex: '#ABB8C3' ,
161- rgb : '171,184,195'
161+ {
162+ color: {
163+ hex: '#F78DA7',
164+ rgb: '247,141,167',
165+ } ,
166+ alt : 'Pink',
162167 },
163- alt: 'Grey'
164- },
165- {
166- color: {
167- hex: '#EB144C' ,
168- rgb : '235,20,76'
168+ {
169+ color: {
170+ hex: '#EB144C',
171+ rgb: '235,20,76',
172+ } ,
173+ alt : 'Red',
169174 },
170- alt: 'Red'
171- },
172- {
173- color: {
174- hex: '#F78DA7',
175- rgb: '247,141,167'
175+ {
176+ color: {
177+ hex: '#ffffff',
178+ rgb: '255,255,255',
179+ },
180+ alt: 'White',
181+ display: {
182+ borderColor: '#ddd',
183+ boxShadowColor: '221,221,221',
184+ },
176185 },
177- alt: 'Pink'
178- },
179- {
180- color: {
181- hex: '#9900EF' ,
182- rgb : '153,0,239'
186+ {
187+ color: {
188+ hex: '#ABB8C3',
189+ rgb: '171,184,195',
190+ } ,
191+ alt : 'Grey',
183192 },
184- alt: 'Violet'
185- },
186- {
187- color: {
188- hex: '#000000' ,
189- rgb : '0,0,0'
193+ {
194+ color: {
195+ hex: '#000000',
196+ rgb: '0,0,0',
197+ } ,
198+ alt : 'Black',
190199 },
191- alt: 'Black'
192- }
193200];
194201```
195202
196203### Theming
197204
198205The following theming options will affect this component if set on its host or parent.
199206
200- | CSS4 variable | Default | Note |
201- | ---------------------------------- | ----------- | ------------------------------------------------------------- |
202- | --deckgo-button-width | 28px | The width of a button to select a color and the more button |
203- | --deckgo-button-height | 28px | The height of a button to select a color and the more button |
204- | --deckgo-button-margin | 4px | The margin of a button to select a color and the more button |
205- | --deckgo-button-outline | none | The outline of a button to select a color and the more button |
206- | --deckgo-button-border | none | The border of a button to select a color and the more button |
207- | --deckgo-button-border-radius | 50% | The border radius of a button to select a color |
208- | --deckgo-button-more-border-radius | 50% | The border radius of the more button |
209- | --deckgo-button-more-border | none | The border of the more button |
210- | --deckgo-button-more-outline | none | The outline of the more button |
211- | --deckgo-flex-wrap | wrap | Wrap properties of the buttons' container |
212- | --deckgo-overflow | visible | Overflow property of the buttons's container |
213- | --deckgo-button-more-background | transparent | The background of the more button |
207+ | CSS4 variable | Default | Note |
208+ | -------------------------------------- | ----------- | ------------------------------------------------------------- |
209+ | --deckgo-button-width | 28px | The width of a button to select a color and the more button |
210+ | --deckgo-button-height | 28px | The height of a button to select a color and the more button |
211+ | --deckgo-button-margin | 4px | The margin of a button to select a color and the more button |
212+ | --deckgo-button-outline | none | The outline of a button to select a color and the more button |
213+ | --deckgo-button-border | none | The border of a button to select a color and the more button |
214+ | --deckgo-button-border-radius | 50% | The border radius of a button to select a color |
215+ | --deckgo-button-more-border-radius | 50% | The border radius of the more button |
216+ | --deckgo-button-more-border | none | The border of the more button |
217+ | --deckgo-button-more-outline | none | The outline of the more button |
218+ | --deckgo-flex-wrap | wrap | Wrap properties of the buttons' container |
219+ | --deckgo-overflow | visible | Overflow property of the buttons's container |
220+ | --deckgo-button-more-background | transparent | The background of the more button |
221+ | --deckgo-color-label-margin | 0 | Margin of the color description |
222+ | --deckgo-color-label-padding | 12px 8px | Padding of the color description |
223+ | --deckgo-color-label-font-size | 12px | Font size of the color description |
224+ | --deckgo-color-label-min-height | 15px | Minimal height of the color description |
225+ | --deckgo-color-label-text-align | center | Text alignment of the color description |
226+ | --deckgo-color-label-color-font-weight | 300 | Font weight of the hexadecimal value of the color description |
214227
215228### Events
216229
0 commit comments