Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Card): Add outline-tint mode #5533

Merged
merged 2 commits into from
Aug 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.