[monorepo][lg] - start of monorepo

This commit is contained in:
Luccas Mateus de Medeiros Gomes
2023-04-10 22:22:34 -03:00
parent a48b394115
commit fda6c4b827
300 changed files with 47972 additions and 130858 deletions

View File

@@ -1,13 +0,0 @@
export default {
primary: '#896A00',
secondary: '#254E70',
black: '#0C0C0C',
positive: '#0C0C0C',
textPrimary: '#896A00',
backgroundPrimary: '#FAEEC5',
// Define font size variables
fontSmall: '18px',
fontMedium: '30px',
fontLarge: '45px',
};

View File

@@ -1,11 +0,0 @@
import base from './base';
import { IThemes } from './utils';
/**
* The default theme to load
*/
export const DEFAULT_THEME = 'base';
export const themes: IThemes = {
base,
};

View File

@@ -1,6 +0,0 @@
import { extend } from './utils';
import base from './base';
export default extend(base, {
// Custom styles for primary theme
});

View File

@@ -1,47 +0,0 @@
import { themes } from './index';
export interface ITheme {
[key: string]: string;
}
export interface IThemes {
[key: string]: ITheme;
}
export interface IMappedTheme {
[key: string]: string | null;
}
export const mapTheme = (variables: ITheme): IMappedTheme => {
return {
'--color-primary': variables.primary || '',
'--color-secondary': variables.secondary || '',
'--color-positive': variables.positive || '',
'--color-negative': variables.negative || '',
'--color-text-primary': variables.textPrimary || '',
'--background-primary': variables.backgroundPrimary || '',
'--background-sec': variables.backgroundSecondary || '',
'--font-size-small': variables.fontSmall || '18px',
'--font-size-medium': variables.fontMedium || '30px',
'--font-size-large': variables.fontLarge || '45px',
};
};
export const applyTheme = (theme: string): void => {
const themeObject: IMappedTheme = mapTheme(themes[theme]);
if (!themeObject) return;
const root = document.documentElement;
Object.keys(themeObject).forEach((property) => {
if (property === 'name') {
return;
}
root.style.setProperty(property, themeObject[property]);
});
};
export const extend = (extending: ITheme, newTheme: ITheme): ITheme => {
return { ...extending, ...newTheme };
};