Skip to content

Commit 93aa96e

Browse files
Issue #740 allow to configure color scheme via config
1 parent d3771fc commit 93aa96e

31 files changed

+265
-243
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ config/cocoda*.json
1414
!config/cocoda.dev.json
1515
!config/cocoda.master.json
1616
# local colors file
17-
src/style/user-colors.less
17+
src/style/user-colors.css
1818

1919
# Relases (when using bin/build-all.sh)
2020
releases/

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,14 @@ Design of cards should roughly adhere to [material design cards](https://materia
113113

114114
### Colors
115115

116-
For interface elements, there is a range of pre-defined colors available in `src/style/colors.less`. For non-linked text, please use one of the following colors:
116+
For interface elements, there is a range of pre-defined colors available in `src/style/colors.css`. For non-linked text, please use one of the following colors:
117117

118118
* CSS class `text-dark`
119119
* CSS class `text-grey`
120120
* CSS class `text-lightGrey`
121121
* CSS class `text-veryLightGrey`
122122

123-
Colors can be overridden using a custom user file in `src/style/user-colors.less`.
123+
Colors can be overridden using a custom user file in `src/style/user-colors.css`, it needs to be imported in `src/style/colors.css`.
124124

125125
### Tables
126126

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ Using the pre-built version, the application only has to be reloaded after editi
114114

115115
## Maintainers
116116

117-
- [@stefandesu](https://github.com/stefandesu)
118117
- [@nichtich](https://github.com/nichtich)
118+
- [@rodolv-commons](https://github.com/rodolv-commons)
119119

120120
## Contribute
121121

src/App.vue

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -809,6 +809,7 @@ export default {
809809

810810
<style lang="less">
811811
@import "./style/main.less";
812+
@import "./style/colors.css";
812813
813814
html, body {
814815
height: 100%;
@@ -826,7 +827,7 @@ html, body {
826827
.main {
827828
flex: 1;
828829
position: relative;
829-
background-color: @color-background-secondary;
830+
background-color: var(--color-background-secondary);
830831
}
831832
.flexbox-row {
832833
display: flex;
@@ -902,7 +903,7 @@ html, body {
902903
width: 100%;
903904
}
904905
.configError {
905-
background-color: @color-background;
906+
background-color: var(--color-background);
906907
width: 100%;
907908
height: 100%;
908909
}
@@ -927,19 +928,19 @@ html, body {
927928
margin: 0 auto;
928929
cursor: pointer;
929930
user-select: none;
930-
color: @color-button;
931+
color: rgb(var(--color-button));
931932
}
932933
#swapSides:hover {
933-
color: @color-button-hover;
934+
color: var(--color-button-hover);
934935
}
935936
936937
.tooltip {
937938
pointer-events: none !important;
938939
}
939940
// Override border color for all cocoda-vue-tabs
940941
.cocoda-vue-tabs-header-item.cocoda-vue-tabs-header-item-active {
941-
border-bottom-color: @color-primary !important;
942-
background-color: @color-background-heading !important;
942+
border-bottom-color: var(--color-primary) !important;
943+
background-color: var(--color-background-heading) !important;
943944
}
944945
// Override font-size for all cocoda-vue-tabs
945946
.cocoda-vue-tabs-sm {

src/ConcordanceApp.vue

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ export default {
328328

329329
<style lang="less">
330330
@import "./style/main.less";
331+
@import "./style/colors.css";
331332
332333
html, body {
333334
height: 100%;
@@ -345,7 +346,7 @@ html, body {
345346
.main {
346347
flex: 1;
347348
position: relative;
348-
background-color: @color-background-secondary;
349+
background-color: var(--color-background-secondary);
349350
}
350351
.flexbox-row {
351352
display: flex;
@@ -435,19 +436,19 @@ html, body {
435436
margin: 0 auto;
436437
cursor: pointer;
437438
user-select: none;
438-
color: @color-button;
439+
color: rgb(var(--color-button));
439440
}
440441
#swapSides:hover {
441-
color: @color-button-hover;
442+
color: var(--color-button-hover);
442443
}
443444
444445
.tooltip {
445446
pointer-events: none !important;
446447
}
447448
// Override border color for all cocoda-vue-tabs
448449
.cocoda-vue-tabs-header-item.cocoda-vue-tabs-header-item-active {
449-
border-bottom-color: @color-primary !important;
450-
background-color: @color-background-heading !important;
450+
border-bottom-color: var(--color-primary) !important;
451+
background-color: var(--color-background-heading) !important;
451452
}
452453
// Override font-size for all cocoda-vue-tabs
453454
.cocoda-vue-tabs-sm {

src/components/AnnotationList.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ export default {
181181
182182
<style lang="less" scoped>
183183
@import "@/style/main.less";
184+
@import "../style/colors.css";
184185
185186
.annotationList {
186187
max-height: 300px;
@@ -206,10 +207,10 @@ export default {
206207
flex-direction: column;
207208
}
208209
.annotationList > div:nth-child(odd) {
209-
background-color: @color-background;
210+
background-color: var(--color-background);
210211
}
211212
.annotationList > div:nth-child(even) {
212-
background-color: fadeout(@color-text-veryLightGrey, 70%);
213+
background-color: var(--color-text-veryLightGrey-opacity);
213214
}
214215
215216
</style>

src/components/AnnotationPopover.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,7 @@ export default {
456456
457457
<style lang="less" scoped>
458458
@import "@/style/main.less";
459+
@import "../style/colors.css";
459460
460461
.annotationPopover {
461462
display: flex;
@@ -504,7 +505,7 @@ export default {
504505
flex: 1;
505506
}
506507
.annotationPopover-voting-button-current {
507-
color: @color-primary;
508+
color: var(--color-primary);
508509
}
509510
510511
.bbutton-small {

src/components/ComponentSettings.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ export default {
160160

161161
<style lang="less" scoped>
162162
@import "@/style/main.less";
163+
@import "../style/colors.css";
163164
164165
.componentSettings {
165166
position: absolute;
@@ -168,9 +169,9 @@ export default {
168169
z-index: @zIndex-2;
169170
}
170171
.componentSettings > .button {
171-
color: @color-button-slightlyFaded;
172+
color: var(--color-button-faded-40);
172173
}
173174
.componentSettings > .button:hover {
174-
color: @color-button-hover;
175+
color: var(--color-button-hover);
175176
}
176177
</style>

src/components/ConceptDetail.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -536,13 +536,14 @@ export default {
536536

537537
<style lang="less" scoped>
538538
@import "@/style/main.less";
539+
@import "../style/colors.css";
539540
540541
.conceptDetail-scheme {
541542
margin-top: 5px;
542543
}
543544
544545
.conceptDetail-name {
545-
background-color: @color-secondary;
546+
background-color: hsl(var(--color-secondary));
546547
position: relative;
547548
padding: 0 20px;
548549
}
@@ -556,7 +557,7 @@ export default {
556557
position: absolute;
557558
right: 3px;
558559
top: -2px;
559-
color: @color-background;
560+
color: var(--color-background);
560561
}
561562
562563
.conceptDetail-identifier {
@@ -612,7 +613,7 @@ export default {
612613
.coli-ana > li > div:first-child {
613614
width: 8px;
614615
user-select: none;
615-
color: @color-text-lightGrey;
616+
color: var(--color-text-lightGrey);
616617
font-weight: normal;
617618
}
618619
.coli-ana > li > div:not(:last-child) {

src/components/ConceptListItem.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@ export default {
361361
362362
<style lang="less" scoped>
363363
@import "@/style/main.less";
364+
@import "../style/colors.css";
364365
365366
.conceptBox {
366367
display: flex;
@@ -397,7 +398,7 @@ export default {
397398
.addToMapping {
398399
.fontSize-large;
399400
position: absolute;
400-
color: @color-background;
401+
color: var(--color-background);
401402
top: 50%;
402403
transform: translateY(-50%);
403404
right: 8px;
@@ -408,7 +409,7 @@ export default {
408409
.selected.hovered,
409410
.arrowBox:hover,
410411
.conceptListItem:hover {
411-
background-color: @color-secondary-light;
412+
background-color: hsl(var(--color-secondary-light));
412413
}
413414
414415
.conceptListItem-buttonBefore {
@@ -418,7 +419,7 @@ export default {
418419
/* For arrows, from https://www.w3schools.com/howto/howto_css_arrows.asp */
419420
// TODO: Use font awesome or move somewhere else
420421
.arrowBox > i {
421-
border: solid @color-black;
422+
border: solid var(--color-black);
422423
border-width: 0 2px 2px 0;
423424
display: inline-block;
424425
padding: 3px;

0 commit comments

Comments
 (0)