Skip to content

Commit

Permalink
feat(Card): Add outline-tint mode (#5533)
Browse files Browse the repository at this point in the history
* feat(Card): Add outline-tint mode
  • Loading branch information
BlackySoul authored Aug 10, 2023
1 parent 38ec4d4 commit 56617e6
Show file tree
Hide file tree
Showing 14 changed files with 35 additions and 23 deletions.
2 changes: 1 addition & 1 deletion packages/vkui/src/components/Card/Card.e2e-playground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const CardPlayground = (props: ComponentPlaygroundProps) => {
{...props}
propSets={[
{
mode: ['tint', 'shadow', 'outline'],
mode: ['tint', 'shadow', 'outline', 'outline-tint'],
},
]}
>
Expand Down
2 changes: 1 addition & 1 deletion packages/vkui/src/components/Card/Card.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
background: var(--vkui--color_background_modal);
}

.Card--mode-outline::after {
.Card--withBorder::after {
position: absolute;
left: 0;
top: 0;
Expand Down
4 changes: 3 additions & 1 deletion packages/vkui/src/components/Card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import styles from './Card.module.css';
export interface CardProps
extends React.HTMLAttributes<HTMLDivElement>,
HasRootRef<HTMLDivElement> {
mode?: 'tint' | 'shadow' | 'outline';
mode?: 'tint' | 'shadow' | 'outline' | 'outline-tint';
}

/**
Expand All @@ -19,6 +19,7 @@ export const Card = ({
className,
...restProps
}: CardProps) => {
const withBorder = mode === 'outline' || mode === 'outline-tint';
return (
<div
{...restProps}
Expand All @@ -27,6 +28,7 @@ export const Card = ({
styles['Card'],
mode === 'outline' && styles['Card--mode-outline'],
mode === 'shadow' && styles['Card--mode-shadow'],
withBorder && styles['Card--withBorder'],
className,
)}
>
Expand Down
10 changes: 10 additions & 0 deletions packages/vkui/src/components/Card/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@
</Card>
</CardGrid>
</Group>
<Group
mode="plain"
header={<Header mode="secondary">С внутренней обводкой и дефолтным фоном</Header>}
>
<CardGrid size="l">
<Card mode="outline-tint">
<div style={{ height: 96 }} />
</Card>
</CardGrid>
</Group>
</Group>
</Panel>
</View>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 56617e6

Please sign in to comment.