Add a custom rule to prevent colors from being hardcoded outside of theme (#288)
* Add a custom rule to prevent colors from being hardcoded in ESLint * Refactor colors * Create packages folder and fix colors * Remove external dependency for css alphabetical order linting * Fix install with yarn --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -22,7 +22,8 @@ type StyledItemProps = {
|
||||
|
||||
const StyledItem = styled.button<StyledItemProps>`
|
||||
align-items: center;
|
||||
background: ${(props) => (props.active ? 'rgba(0, 0, 0, 0.04)' : 'inherit')};
|
||||
background: ${(props) =>
|
||||
props.active ? props.theme.lightBackgroundTransparent : 'inherit'};
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
color: ${(props) => {
|
||||
@ -47,7 +48,7 @@ const StyledItem = styled.button<StyledItemProps>`
|
||||
padding-top: ${(props) => props.theme.spacing(1)};
|
||||
pointer-events: ${(props) => (props.soon ? 'none' : 'auto')};
|
||||
:hover {
|
||||
background: rgba(0, 0, 0, 0.04);
|
||||
background: ${(props) => props.theme.lightBackgroundTransparent};
|
||||
color: ${(props) => (props.danger ? props.theme.red : props.theme.text100)};
|
||||
}
|
||||
user-select: none;
|
||||
@ -67,7 +68,7 @@ const StyledSoonPill = styled.div`
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border-radius: 50px;
|
||||
background-color: rgba(0, 0, 0, 0.04);
|
||||
background-color: ${(props) => props.theme.lightBackgroundTransparent};
|
||||
font-size: ${(props) => props.theme.fontSizeExtraSmall};
|
||||
padding: ${(props) => props.theme.spacing(1)}
|
||||
${(props) => props.theme.spacing(2)} ${(props) => props.theme.spacing(1)}
|
||||
|
||||
@ -20,7 +20,7 @@ const StyledButton = styled.button`
|
||||
|
||||
width: 24px;
|
||||
&:hover {
|
||||
background: ${(props) => props.theme.clickableElementBackgroundHover};
|
||||
background: ${(props) => props.theme.lightBackgroundTransparent};
|
||||
}
|
||||
svg {
|
||||
color: ${(props) => props.theme.text40};
|
||||
|
||||
@ -48,12 +48,15 @@ const lightThemeSpecific = {
|
||||
|
||||
primaryBackgroundTransparent: 'rgba(255, 255, 255, 0.8)',
|
||||
secondaryBackgroundTransparent: 'rgba(252, 252, 252, 0.8)',
|
||||
strongBackgroundTransparent: 'rgba(0, 0, 0, 0.16)',
|
||||
mediumBackgroundTransparent: 'rgba(0, 0, 0, 0.08)',
|
||||
lightBackgroundTransparent: 'rgba(0, 0, 0, 0.04)',
|
||||
lighterBackgroundTransparent: 'rgba(0, 0, 0, 0.02)',
|
||||
|
||||
primaryBorder: 'rgba(0, 0, 0, 0.08)',
|
||||
lightBorder: '#f5f5f5',
|
||||
mediumBorder: '#ebebeb',
|
||||
|
||||
clickableElementBackgroundHover: 'rgba(0, 0, 0, 0.04)',
|
||||
clickableElementBackgroundTransition: 'background 0.1s ease',
|
||||
|
||||
text100: '#000',
|
||||
@ -93,8 +96,11 @@ const darkThemeSpecific: typeof lightThemeSpecific = {
|
||||
|
||||
primaryBackgroundTransparent: 'rgba(20, 20, 20, 0.8)',
|
||||
secondaryBackgroundTransparent: 'rgba(23, 23, 23, 0.8)',
|
||||
strongBackgroundTransparent: 'rgba(255, 255, 255, 0.09)',
|
||||
mediumBackgroundTransparent: 'rgba(255, 255, 255, 0.06)',
|
||||
lightBackgroundTransparent: 'rgba(255, 255, 255, 0.03)',
|
||||
lighterBackgroundTransparent: 'rgba(255, 255, 255, 0.02)',
|
||||
|
||||
clickableElementBackgroundHover: 'rgba(0, 0, 0, 0.04)',
|
||||
clickableElementBackgroundTransition: 'background 0.1s ease',
|
||||
|
||||
primaryBorder: 'rgba(255, 255, 255, 0.08)',
|
||||
@ -148,7 +154,7 @@ export const hoverBackground = (props: any) =>
|
||||
css`
|
||||
transition: background 0.1s ease;
|
||||
&:hover {
|
||||
background: rgba(0, 0, 0, 0.04);
|
||||
background: ${props.theme.lightBackgroundTransparent};
|
||||
}
|
||||
`;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user