Skip to content

Commit 95b8dc3

Browse files
authored
Merge pull request DSpace#1923 from 4Science/CST-6171
Customizability of theme colours
2 parents fd37c72 + c151cf3 commit 95b8dc3

7 files changed

Lines changed: 50 additions & 13 deletions

File tree

src/app/navbar/navbar.component.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
nav.navbar {
2-
border-bottom: 1px var(--bs-gray-400) solid;
2+
border-bottom: 1px var(--ds-header-navbar-border-bottom-color) solid;
33
align-items: baseline;
44
}
55

src/app/shared/object-collection/shared/mydspace-item-status/my-dspace-item-status.component.spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,34 +55,34 @@ describe('MyDSpaceItemStatusComponent', () => {
5555
component.status = MyDspaceItemStatusType.VALIDATION;
5656
fixture.detectChanges();
5757
expect(component.badgeContent).toBe(MyDspaceItemStatusType.VALIDATION);
58-
expect(component.badgeClass).toBe('text-light badge badge-warning');
58+
expect(component.badgeClass).toBe('text-light badge badge-validation');
5959
});
6060

6161
it('should init badge content and class', () => {
6262
component.status = MyDspaceItemStatusType.WAITING_CONTROLLER;
6363
fixture.detectChanges();
6464
expect(component.badgeContent).toBe(MyDspaceItemStatusType.WAITING_CONTROLLER);
65-
expect(component.badgeClass).toBe('text-light badge badge-info');
65+
expect(component.badgeClass).toBe('text-light badge badge-waiting-controller');
6666
});
6767

6868
it('should init badge content and class', () => {
6969
component.status = MyDspaceItemStatusType.WORKSPACE;
7070
fixture.detectChanges();
7171
expect(component.badgeContent).toBe(MyDspaceItemStatusType.WORKSPACE);
72-
expect(component.badgeClass).toBe('text-light badge badge-primary');
72+
expect(component.badgeClass).toBe('text-light badge badge-workspace');
7373
});
7474

7575
it('should init badge content and class', () => {
7676
component.status = MyDspaceItemStatusType.ARCHIVED;
7777
fixture.detectChanges();
7878
expect(component.badgeContent).toBe(MyDspaceItemStatusType.ARCHIVED);
79-
expect(component.badgeClass).toBe('text-light badge badge-success');
79+
expect(component.badgeClass).toBe('text-light badge badge-archived');
8080
});
8181

8282
it('should init badge content and class', () => {
8383
component.status = MyDspaceItemStatusType.WORKFLOW;
8484
fixture.detectChanges();
8585
expect(component.badgeContent).toBe(MyDspaceItemStatusType.WORKFLOW);
86-
expect(component.badgeClass).toBe('text-light badge badge-info');
86+
expect(component.badgeClass).toBe('text-light badge badge-workflow');
8787
});
8888
});

src/app/shared/object-collection/shared/mydspace-item-status/my-dspace-item-status.component.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,19 @@ export class MyDSpaceItemStatusComponent implements OnInit {
3434
this.badgeClass = 'text-light badge ';
3535
switch (this.status) {
3636
case MyDspaceItemStatusType.VALIDATION:
37-
this.badgeClass += 'badge-warning';
37+
this.badgeClass += 'badge-validation';
3838
break;
3939
case MyDspaceItemStatusType.WAITING_CONTROLLER:
40-
this.badgeClass += 'badge-info';
40+
this.badgeClass += 'badge-waiting-controller';
4141
break;
4242
case MyDspaceItemStatusType.WORKSPACE:
43-
this.badgeClass += 'badge-primary';
43+
this.badgeClass += 'badge-workspace';
4444
break;
4545
case MyDspaceItemStatusType.ARCHIVED:
46-
this.badgeClass += 'badge-success';
46+
this.badgeClass += 'badge-archived';
4747
break;
4848
case MyDspaceItemStatusType.WORKFLOW:
49-
this.badgeClass += 'badge-info';
49+
this.badgeClass += 'badge-workflow';
5050
break;
5151
}
5252
}

src/styles/_global-styles.scss

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,3 +204,27 @@ ds-dynamic-form-control-container.d-none {
204204
}
205205

206206

207+
208+
.badge-validation {
209+
background-color: #{map-get($theme-colors, warning)};
210+
}
211+
212+
.badge-waiting-controller {
213+
background-color: #{map-get($theme-colors, info)};
214+
}
215+
216+
.badge-workspace {
217+
background-color: #{map-get($theme-colors, primary)};
218+
}
219+
220+
.badge-archived {
221+
background-color: #{map-get($theme-colors, success)};
222+
}
223+
224+
.badge-workflow {
225+
background-color: #{map-get($theme-colors, info)};
226+
}
227+
228+
.badge-item-type {
229+
background-color: #{map-get($theme-colors, info)};
230+
}

src/themes/dspace/app/navbar/navbar.component.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
nav.navbar {
22
border-top: 1px var(--ds-header-navbar-border-top-color) solid;
3-
border-bottom: 5px var(--bs-green) solid;
3+
border-bottom: 5px var(--ds-header-navbar-border-bottom-color) solid;
44
align-items: baseline;
55
color: var(--ds-header-icon-color);
66
}

src/themes/dspace/styles/_theme_css_variable_overrides.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@
66
--ds-banner-background-gradient-width: 300px;
77
--ds-home-news-link-color: #{$green};
88
--ds-home-news-link-hover-color: #{darken($green, 15%)};
9+
--ds-header-navbar-border-bottom-color: #{$green};
910
}
1011

src/themes/dspace/styles/_theme_sass_variable_overrides.scss

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@ $font-family-sans-serif: 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI"
1010
$navbar-dark-color: #FFFFFF;
1111

1212
/* Reassign color vars to semantic color scheme */
13-
$blue: #43515f !default;
13+
$blue: #2b4e72 !default;
1414
$green: #92C642 !default;
1515
$cyan: #207698 !default;
1616
$yellow: #ec9433 !default;
1717
$red: #CF4444 !default;
1818
$dark: #43515f !default;
1919

2020
$gray-800: #343a40 !default;
21+
$gray-700: #495057 !default;
2122
$gray-400: #ced4da !default;
2223
$gray-100: #f8f9fa !default;
2324

@@ -27,3 +28,14 @@ $table-accent-bg: $gray-100 !default; // Bootstrap $gray-100
2728
$table-hover-bg: $gray-400 !default; // Bootstrap $gray-400
2829

2930
$yiq-contrasted-threshold: 170 !default;
31+
32+
$theme-colors: (
33+
primary: $dark,
34+
secondary: $gray-700,
35+
success: $green,
36+
info: $cyan,
37+
warning: $yellow,
38+
danger: $red,
39+
light: $gray-100,
40+
dark: $dark
41+
) !default;

0 commit comments

Comments
 (0)