-
-
Notifications
You must be signed in to change notification settings - Fork 346
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Bubble support more variant (#140)
* feat: variant * test: update snapshot * chore: fix lint * chore: force * chore: rm lock file * chore: back of package.json
- Loading branch information
Showing
7 changed files
with
556 additions
and
282 deletions.
There are no files selected for viewing
381 changes: 249 additions & 132 deletions
381
components/bubble/__tests__/__snapshots__/demo-extend.test.ts.snap
Large diffs are not rendered by default.
Oops, something went wrong.
381 changes: 249 additions & 132 deletions
381
components/bubble/__tests__/__snapshots__/demo.test.ts.snap
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { unit } from '@ant-design/cssinjs'; | ||
import type { BubbleToken } from '.'; | ||
import type { GenerateStyle } from '../../theme/cssinjs-utils'; | ||
|
||
const genVariantStyle: GenerateStyle<BubbleToken> = (token) => { | ||
const { componentCls, paddingSM, padding } = token; | ||
return { | ||
[componentCls]: { | ||
[`${componentCls}-content`]: { | ||
// Shared: filled, outlined, shadow | ||
'&-filled,&-outlined,&-shadow': { | ||
padding: `${unit(paddingSM)} ${unit(padding)}`, | ||
borderRadius: token.borderRadiusLG, | ||
}, | ||
|
||
// Filled: | ||
'&-filled': { | ||
backgroundColor: token.colorFillContent, | ||
}, | ||
|
||
// Outlined: | ||
'&-outlined': { | ||
border: `1px solid ${token.colorBorderSecondary}`, | ||
}, | ||
|
||
// Shadow: | ||
'&-shadow': { | ||
boxShadow: token.boxShadowTertiary, | ||
}, | ||
}, | ||
}, | ||
}; | ||
}; | ||
|
||
export default genVariantStyle; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters