Skip to content

Commit

Permalink
fix(field): fix theme
Browse files Browse the repository at this point in the history
  • Loading branch information
alyleui committed Oct 13, 2018
1 parent 236973e commit 8542964
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 10 deletions.
5 changes: 4 additions & 1 deletion src/lib/field/field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ const styles = (theme: ThemeVariables) => {
...LY_COMMON_STYLES.fill,
pointerEvents: 'none',
display: 'flex',
width: '100%'
width: '100%',
'& > div': {
color: theme.input.borderColor
}
},
labelSpacingStart: {},
labelCenter: {
Expand Down
28 changes: 24 additions & 4 deletions src/lib/src/theme/theme-config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { InjectionToken } from '@angular/core';
import { LyStyleUtils } from '../style-utils';
import { StyleContainer } from './theme2.service';

export const LY_THEME_GLOBAL_VARIABLES = new InjectionToken<PartialThemeVariables>('ly.theme.global.variables');
export const LY_THEME = new InjectionToken<ThemeConfig | ThemeConfig[]>('ly_theme_config');
Expand Down Expand Up @@ -51,10 +52,29 @@ export interface ThemeConfig {
backdrop: string
};
input: {
label: string,
underline: string,
/** default color */
withColor: string
/** @deprecated */
label?: string
/** @deprecated */
underline?: string
/** @deprecated */
withColor?: string
borderColor: string
appearance: {
[appearanceName: string]: {
containerLabel?: StyleContainer
containerLabelFocused?: StyleContainer
containerLabelHover?: StyleContainer
label?: StyleContainer
placeholder?: StyleContainer
input?: StyleContainer
labelFloating?: StyleContainer
containerLabelStart?: StyleContainer
containerLabelCenter?: StyleContainer
containerLabelCenterFloating?: StyleContainer
containerLabelEnd?: StyleContainer
container?: StyleContainer
}
}
};
iconButton: {
size: string
Expand Down
5 changes: 4 additions & 1 deletion src/lib/themes/minima/dark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,11 @@ export class MinimaDark extends MinimaBase implements ThemeConfig {
colorShadow = shadow;
shadow = shadow;
input = {
/** @deprecated */
label: 'rgba(255, 255, 255, 0.4)',
/** @deprecated */
underline: 'rgba(255, 255, 255, 0.11)',
...input
...input,
borderColor: 'rgba(255, 255, 255, 0.12)'
};
}
6 changes: 4 additions & 2 deletions src/lib/themes/minima/light.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,11 @@ export class MinimaLight extends MinimaBase implements ThemeConfig {
};
bar = '#f5f5f5';
input = {
/** @deprecated */
label: 'rgba(0, 0, 0, 0.6)',
/** @deprecated */
underline: 'rgba(0, 0, 0, 0.11)',
/** default color */
...input
...input,
borderColor: 'rgba(0, 0, 0, 0.12)'
};
}
2 changes: 0 additions & 2 deletions src/lib/themes/minima/variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ export const input = {
appearance: {
standard: {
containerLabel: {
color: 'rgba(0,0,0,.12)',
borderBottom: 'solid 1px currentColor'
},
containerLabelFocused: {
Expand Down Expand Up @@ -114,7 +113,6 @@ export const input = {
}, // default & important
outlined: {
containerLabel: {
color: 'rgba(0,0,0,.12)',
'&:before': {
...LY_COMMON_STYLES.fill,
content: `\'\'`
Expand Down

0 comments on commit 8542964

Please sign in to comment.