Skip to content

Commit

Permalink
Merge pull request #219 from oceanbase/dengfuping-dev
Browse files Browse the repository at this point in the history
chore: Format code by prettier
  • Loading branch information
dengfuping authored Oct 25, 2023
2 parents 98cdb52 + 936583f commit 871405b
Show file tree
Hide file tree
Showing 8 changed files with 111 additions and 111 deletions.
11 changes: 8 additions & 3 deletions packages/codemod/transforms/__tests__/less-to-token.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@ const tests = ['antd-v4-less-to-token', 'obui-less-to-token'];
describe(testUnit, () => {
tests.forEach(test => {
it(test, async () => {
const result = await transform(path.join(__dirname, `../__testfixtures__/less-to-token/${test}.input.less`))
const output = fs.readFileSync(path.join(__dirname, `../__testfixtures__/less-to-token/${test}.output.less`), 'utf-8');
const result = await transform(
path.join(__dirname, `../__testfixtures__/less-to-token/${test}.input.less`)
);
const output = fs.readFileSync(
path.join(__dirname, `../__testfixtures__/less-to-token/${test}.output.less`),
'utf-8'
);
expect(result).toEqual(output);
})
});
});
});
59 changes: 28 additions & 31 deletions packages/ui/src/BasicLayout/style/Header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,78 +4,76 @@ import { genComponentStyleHook } from '../../_util/genComponentStyleHook';

export type HeaderToken = FullToken<any>;

export const genHeaderStyle: GenerateStyle<HeaderToken> = (
token: HeaderToken
): CSSObject => {
export const genHeaderStyle: GenerateStyle<HeaderToken> = (token: HeaderToken): CSSObject => {
const { antCls, componentCls } = token;

return {
[`${componentCls}`]: {
position: "fixed",
position: 'fixed',
zIndex: 10,
width: "100%",
width: '100%',
height: 48,
padding: "10px 24px",
padding: '10px 24px',
lineHeight: '48px',
backgroundColor: token.colorBgLayout,
boxShadow: `inset 0 -1px 0 0 ${token.colorBorderSecondary}`,

[`${componentCls}-content`]: {
display: "flex",
alignItems: "center",
justifyContent: "space-between",
display: 'flex',
alignItems: 'center',
justifyContent: 'space-between',
maxWidth: token.maxWidth,
height: "100%",
margin: "0 auto",
height: '100%',
margin: '0 auto',
},

[`${componentCls}-logo`]: {
height: 24,
cursor: 'pointer'
cursor: 'pointer',
},
[`${componentCls}-icon`]: {
width: 52,
height: 48,
lineHeight: '48px',
textAlign: "center",
textAlign: 'center',
borderRight: `1px solid ${token.colorBorderSecondary}`,
borderBottom: `1px solid ${token.colorBorderSecondary}`,
cursor: "pointer",
cursor: 'pointer',
img: {
height: 32,
marginTop: 8
marginTop: 8,
},
},
[`${componentCls}-title`]: {
/* 占据剩余的全部空间 */
flex: 1,
margin: "0 16px",
margin: '0 16px',
},

[`${componentCls}-extra`]: {
display: "flex",
alignItems: "center",
justifyContent: "space-between",
display: 'flex',
alignItems: 'center',
justifyContent: 'space-between',
[`${componentCls}-extra-item`]: {
display: "inline-flex",
display: 'inline-flex',
fontSize: 12,
cursor: "pointer",
cursor: 'pointer',
'&:not(:last-child)': {
marginRight: 24
marginRight: 24,
},
[`${componentCls}-extra-icon-wrapper`]: {
width: 28,
height: 28,
lineHeight: '28px',
textAlign: "center",
border: "0.88px solid #ced4e1",
textAlign: 'center',
border: '0.88px solid #ced4e1',
borderRadius: 14,
},
[`${componentCls}-extra-user-wrapper`]: {
height: 28,
padding: "0 10px",
padding: '0 10px',
lineHeight: '28px',
border: "0.88px solid #ced4e1",
border: '0.88px solid #ced4e1',
borderRadius: 14,
[`${componentCls}-extra-user-icon`]: {
marginRight: 6,
Expand All @@ -87,9 +85,9 @@ export const genHeaderStyle: GenerateStyle<HeaderToken> = (
[`${componentCls}-extra-with-label`]: {
[`${componentCls}-extra-item`]: {
'&:not(:last-child)': {
marginRight: '24px !important'
}
}
marginRight: '24px !important',
},
},
},
},

Expand All @@ -113,8 +111,7 @@ export const genHeaderStyle: GenerateStyle<HeaderToken> = (
fontSize: 12,
color: token.colorTextTertiary,
},
}

},
};
};

Expand Down
Loading

0 comments on commit 871405b

Please sign in to comment.