Skip to content

Commit 91666a3

Browse files
Celeste Glavinadamraider
authored andcommitted
fix: update hover/active states for card border and title (#86)
* fix: add active color to cards and title * chore: update stories * fix: update colors to match spec * docs: update link to not actually go anywhere * docs: add note about new title class * Update docs/html/card/card--link.html Co-Authored-By: cmugla <celeste.glavin@wework.com> * fix(card): update card styles, removes card--link * Update card.html * fix: update card spacing
1 parent 9965b16 commit 91666a3

File tree

5 files changed

+39
-117
lines changed

5 files changed

+39
-117
lines changed

docs/components/card.md

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,11 @@ label: Component
33
title: Card
44
---
55

6-
<page-intro>Cards are a unit of content, they typically have an image, a heading, and a small amount of copy. They are often used as links.</page-intro>
6+
<page-intro>Cards are a unit of content, they typically have an image, a heading, and a small amount of copy.</page-intro>
77

8-
<component
8+
<component
99
name="Card"
1010
component="card"
11-
variation="card"
11+
variation="card"
1212
>
1313
</component>
14-
15-
<component
16-
name="Card as a link"
17-
component="card"
18-
variation="card--link"
19-
>
20-
</component>
21-
22-
## Modifiers
23-
24-
Use these modifiers with `.ray-card` class.
25-
26-
| Selector | Description |
27-
| ----------------- | ------------------------------------------- |
28-
| `.ray-card--link` | Selector for applying link and hover styles |

docs/html/card/card--link.html

Lines changed: 0 additions & 22 deletions
This file was deleted.

docs/html/card/card.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@
77
</div>
88

99
<div class="ray-card__content">
10-
<h4 class="ray-text--h4">Nicolas Boer 399</h4>
10+
<p class="ray-text--body-large">
11+
<a aria-label="go to Better Together page" href="javascript:;"
12+
>Better Together</a
13+
>
14+
</p>
15+
1116
<div>
1217
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolorem atque
1318
minima itaque sint! Doloremque odio quia saepe.

packages/core/src/components/card/_card.scss

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -13,38 +13,6 @@
1313
flex-direction: column;
1414
position: relative;
1515

16-
&--link {
17-
cursor: pointer;
18-
color: $ray-color-text-dark;
19-
20-
&:hover,
21-
&:focus {
22-
text-decoration: none;
23-
}
24-
25-
&:focus {
26-
box-shadow: $ray-box-shadow-focus-state;
27-
}
28-
29-
&:hover {
30-
&::after {
31-
border-color: $ray-color-blue-50;
32-
}
33-
}
34-
35-
&::after {
36-
content: '';
37-
border: 1px solid transparent;
38-
position: absolute;
39-
top: 0;
40-
left: 0;
41-
right: 0;
42-
bottom: 0;
43-
border-radius: $ray-border-radius;
44-
pointer-events: none;
45-
}
46-
}
47-
4816
&__content {
4917
flex-grow: 1;
5018
padding: $card-padding;

packages/core/stories/card.stories.js

Lines changed: 30 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@ import { storiesOf } from '@storybook/react';
33

44
import getPlaceholderURL from './util/placeholder';
55

6+
/* eslint-disable no-script-url */
67
storiesOf('Card', module)
7-
.add('card, link, image on top', () => (
8-
<a
9-
href="https://wework.com"
10-
target="_blank"
11-
rel="noopener noreferrer"
12-
className="ray-card ray-card--link"
8+
.add('card, with image on top', () => (
9+
<div
10+
className="ray-card"
1311
style={{
1412
maxWidth: '480px'
1513
}}
@@ -19,26 +17,29 @@ storiesOf('Card', module)
1917
</div>
2018

2119
<div className="ray-card__content">
22-
<h4 className="ray-text--h4">Nicolas Boer 399</h4>
20+
<div className="ray-text--body-large">
21+
<a href="javascript:;">Better Together</a>
22+
</div>
23+
2324
<p>
2425
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolorem
2526
atque minima itaque sint! Doloremque odio quia saepe.
2627
</p>
2728
</div>
28-
</a>
29+
</div>
2930
))
30-
.add('card, link, image on bottom', () => (
31-
<a
32-
href="https://wework.com"
33-
target="_blank"
34-
rel="noopener noreferrer"
35-
className="ray-card ray-card--link"
31+
.add('card, with image on bottom', () => (
32+
<div
33+
className="ray-card"
3634
style={{
3735
maxWidth: '480px'
3836
}}
3937
>
4038
<div className="ray-card__content">
41-
<h4 className="ray-text--h4">Nicolas Boer 399</h4>
39+
<div className="ray-text--body-large">
40+
<a href="javascript:;">Better Together</a>
41+
</div>
42+
4243
<p>
4344
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolorem
4445
atque minima itaque sint! Doloremque odio quia saepe.
@@ -48,10 +49,10 @@ storiesOf('Card', module)
4849
<div className="ray-card__image ray-image ray-image--16by9">
4950
<img src={getPlaceholderURL('800x450')} />
5051
</div>
51-
</a>
52+
</div>
5253
))
53-
.add('card, link, no image', () => (
54-
<a
54+
.add('card, no image', () => (
55+
<div
5556
href="https://wework.com"
5657
target="_blank"
5758
rel="noopener noreferrer"
@@ -61,13 +62,16 @@ storiesOf('Card', module)
6162
}}
6263
>
6364
<div className="ray-card__content">
64-
<h4 className="ray-text--h4">Nicolas Boer 399</h4>
65+
<div className="ray-text--body-large">
66+
<a href="javascript:;">Better Together</a>
67+
</div>
68+
6569
<p>
6670
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolorem
6771
atque minima itaque sint! Doloremque odio quia saepe.
6872
</p>
6973
</div>
70-
</a>
74+
</div>
7175
))
7276
.add('card, image on top, with buttons', () => (
7377
<div
@@ -81,39 +85,21 @@ storiesOf('Card', module)
8185
</div>
8286

8387
<div className="ray-card__content">
84-
<h4 className="ray-text--h4">Nicolas Boer 399</h4>
85-
<p>
88+
<div className="ray-text--body-large">
89+
<a href="javascript:;">Better Together</a>
90+
</div>
91+
92+
<p className="ray-text--body">
8693
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolorem
8794
atque minima itaque sint! Doloremque odio quia saepe.
8895
</p>
96+
8997
<button className="ray-button ray-button--primary ray-button--compact">
9098
Sign Up Now
9199
</button>
92-
<button className="ray-button ray-button--secondary ray-button--compact">
93-
Learn More
94-
</button>
95100
<button className="ray-button ray-button--tertiary ray-button--compact">
96101
Share
97102
</button>
98103
</div>
99104
</div>
100-
))
101-
.add('card, tertiary button', () => (
102-
<div
103-
className="ray-card"
104-
style={{
105-
maxWidth: '480px'
106-
}}
107-
>
108-
<div className="ray-card__content">
109-
<h4 className="ray-text--h4">Nicolas Boer 399</h4>
110-
<p>
111-
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolorem
112-
atque minima itaque sint! Doloremque odio quia saepe.
113-
</p>
114-
<button className="ray-button ray-button--tertiary ray-button--pull-left ray-button--compact">
115-
Share
116-
</button>
117-
</div>
118-
</div>
119105
));

0 commit comments

Comments
 (0)