mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 18:14:17 +00:00
94233: use actual CSS variables in theme
This commit is contained in:
20
src/app/shared/sass-helper/css-variable.reducer.ts
Normal file
20
src/app/shared/sass-helper/css-variable.reducer.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { CSSVariableAction, CSSVariableActionTypes } from './css-variable.actions';
|
||||
|
||||
export interface CSSVariablesState {
|
||||
[name: string]: string;
|
||||
}
|
||||
|
||||
const initialState: CSSVariablesState = Object.create({});
|
||||
|
||||
export function cssVariablesReducer(state = initialState, action: CSSVariableAction): CSSVariablesState {
|
||||
switch (action.type) {
|
||||
case CSSVariableActionTypes.ADD: {
|
||||
const variable = action.payload;
|
||||
const t = Object.assign({}, state, { [variable.name]: variable.value });
|
||||
return t;
|
||||
}
|
||||
default: {
|
||||
return state;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user