Skip to content
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rolemodel/optics",
"version": "2.1.3",
"version": "2.1.4",
"packageManager": "yarn@4.8.1",
"description": "Optics is a css package that provides base styles and components that can be integrated and customized in a variety of projects.",
"main": "dist/css/optics.css",
Expand Down
12 changes: 10 additions & 2 deletions src/components/card.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
/* Public API (customizable component options) */
--_op-card-padding: var(--op-space-medium);
--_op-card-box-shadow: var(--op-border-all) var(--op-color-border);
--_op-card-radius: var(--op-radius-medium);

position: relative;
border-radius: var(--op-radius-medium);
border-radius: var(--_op-card-radius);
background-color: var(--op-color-background);
box-shadow: var(--_op-card-box-shadow);
color: var(--op-color-on-background);
contain: paint;
font-size: var(--op-font-medium);
line-height: var(--op-line-height-base);

Expand Down Expand Up @@ -50,6 +50,9 @@
}

.card__header {
border-top-left-radius: var(--_op-card-radius);
border-top-right-radius: var(--_op-card-radius);

h1,
h2,
h3,
Expand All @@ -59,4 +62,9 @@
margin: 0;
}
}

.card__footer {
border-bottom-left-radius: var(--_op-card-radius);
border-bottom-right-radius: var(--_op-card-radius);
}
}
13 changes: 12 additions & 1 deletion src/stories/Components/Card/Card.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ Card can be used as a standalone component, however, it does have a few dependen

<Canvas of={CardStories.Shadow} />

## Card API

Padding, Box Shadow (border), and Radius styles are built on css variables scoped to the card. They can ben overridden to customize the card.

```css
--_op-card-padding
--_op-card-box-shadow
--_op-card-radius
```

## Customizing Card styles

<div
Expand Down Expand Up @@ -117,7 +127,8 @@ Your application may need a variation. To add one, just follow this template. No

```css
.card--purple {
border-radius: var(--op-radius-large);
--_op-card-radius: var(--op-radius-large);

font-size: var(--op-font-2x-large);

.card__header {
Expand Down