ant-design/components/_util/theme/util/index.tsx
MadCcc 228d451832
refactor: input support cssinjs (#34288)
* refactor: input with cssinjs

* refactor: input cssinjs

* refactor: rtl

* chore: code clean

* chore: code clean

* refactor: adapt hash

* refactor: use input token

* refactor: status

* fix: style

* fix: rtl

* chore: update token

* chore: code clean

* chore: code clean

* chore: code clean

* refactor: enhance token

* fix: enhance padding

* perf: replace rtl styles

* refactor: place placeholder in input

* perf: rtl

* refactor: code perf

* style: code style

* fix: prefixCls
2022-03-09 10:38:02 +08:00

57 lines
1.4 KiB
TypeScript

/* eslint-disable import/prefer-default-export */
import { CSSObject } from '@ant-design/cssinjs';
import type { DerivativeToken } from '..';
export const resetComponent = (token: DerivativeToken): CSSObject => ({
boxSizing: 'border-box',
margin: 0,
padding: 0,
color: token.textColor,
fontSize: token.fontSize,
// font-variant: @font-variant-base;
lineHeight: token.lineHeight,
listStyle: 'none',
// font-feature-settings: @font-feature-settings-base;
});
export const resetIcon = (): CSSObject => ({
display: 'inline-block',
color: 'inherit',
fontStyle: 'normal',
lineHeight: 0,
textAlign: 'center',
textTransform: 'none',
// for SVG icon, see https://blog.prototypr.io/align-svg-icons-to-text-and-say-goodbye-to-font-icons-d44b3d7b26b4
verticalAlign: '-0.125em',
textRendering: 'optimizeLegibility',
'-webkit-font-smoothing': 'antialiased',
'-moz-osx-font-smoothing': 'grayscale',
'> *': {
lineHeight: 1,
},
svg: {
display: 'inline-block',
},
'& &-icon': {
display: 'block',
},
});
export const clearFix = (): CSSObject => ({
// https://github.com/ant-design/ant-design/issues/21301#issuecomment-583955229
'&::before': {
display: 'table',
content: '""',
},
'&::after': {
// https://github.com/ant-design/ant-design/issues/21864
display: 'table',
clear: 'both',
content: '""',
},
});