Skip to content

Commit

Permalink
fix: update hover/active states for card border and title (#86)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Celeste Glavin authored and adamraider committed Mar 27, 2019
1 parent 9965b16 commit 91666a3
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 117 deletions.
21 changes: 3 additions & 18 deletions docs/components/card.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,11 @@ label: Component
title: Card
---

<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>
<page-intro>Cards are a unit of content, they typically have an image, a heading, and a small amount of copy.</page-intro>

<component
<component
name="Card"
component="card"
variation="card"
variation="card"
>
</component>

<component
name="Card as a link"
component="card"
variation="card--link"
>
</component>

## Modifiers

Use these modifiers with `.ray-card` class.

| Selector | Description |
| ----------------- | ------------------------------------------- |
| `.ray-card--link` | Selector for applying link and hover styles |
22 changes: 0 additions & 22 deletions docs/html/card/card--link.html

This file was deleted.

7 changes: 6 additions & 1 deletion docs/html/card/card.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
</div>

<div class="ray-card__content">
<h4 class="ray-text--h4">Nicolas Boer 399</h4>
<p class="ray-text--body-large">
<a aria-label="go to Better Together page" href="javascript:;"
>Better Together</a
>
</p>

<div>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolorem atque
minima itaque sint! Doloremque odio quia saepe.
Expand Down
32 changes: 0 additions & 32 deletions packages/core/src/components/card/_card.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,38 +13,6 @@
flex-direction: column;
position: relative;

&--link {
cursor: pointer;
color: $ray-color-text-dark;

&:hover,
&:focus {
text-decoration: none;
}

&:focus {
box-shadow: $ray-box-shadow-focus-state;
}

&:hover {
&::after {
border-color: $ray-color-blue-50;
}
}

&::after {
content: '';
border: 1px solid transparent;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
border-radius: $ray-border-radius;
pointer-events: none;
}
}

&__content {
flex-grow: 1;
padding: $card-padding;
Expand Down
74 changes: 30 additions & 44 deletions packages/core/stories/card.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ import { storiesOf } from '@storybook/react';

import getPlaceholderURL from './util/placeholder';

/* eslint-disable no-script-url */
storiesOf('Card', module)
.add('card, link, image on top', () => (
<a
href="https://wework.com"
target="_blank"
rel="noopener noreferrer"
className="ray-card ray-card--link"
.add('card, with image on top', () => (
<div
className="ray-card"
style={{
maxWidth: '480px'
}}
Expand All @@ -19,26 +17,29 @@ storiesOf('Card', module)
</div>

<div className="ray-card__content">
<h4 className="ray-text--h4">Nicolas Boer 399</h4>
<div className="ray-text--body-large">
<a href="javascript:;">Better Together</a>
</div>

<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolorem
atque minima itaque sint! Doloremque odio quia saepe.
</p>
</div>
</a>
</div>
))
.add('card, link, image on bottom', () => (
<a
href="https://wework.com"
target="_blank"
rel="noopener noreferrer"
className="ray-card ray-card--link"
.add('card, with image on bottom', () => (
<div
className="ray-card"
style={{
maxWidth: '480px'
}}
>
<div className="ray-card__content">
<h4 className="ray-text--h4">Nicolas Boer 399</h4>
<div className="ray-text--body-large">
<a href="javascript:;">Better Together</a>
</div>

<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolorem
atque minima itaque sint! Doloremque odio quia saepe.
Expand All @@ -48,10 +49,10 @@ storiesOf('Card', module)
<div className="ray-card__image ray-image ray-image--16by9">
<img src={getPlaceholderURL('800x450')} />
</div>
</a>
</div>
))
.add('card, link, no image', () => (
<a
.add('card, no image', () => (
<div
href="https://wework.com"
target="_blank"
rel="noopener noreferrer"
Expand All @@ -61,13 +62,16 @@ storiesOf('Card', module)
}}
>
<div className="ray-card__content">
<h4 className="ray-text--h4">Nicolas Boer 399</h4>
<div className="ray-text--body-large">
<a href="javascript:;">Better Together</a>
</div>

<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolorem
atque minima itaque sint! Doloremque odio quia saepe.
</p>
</div>
</a>
</div>
))
.add('card, image on top, with buttons', () => (
<div
Expand All @@ -81,39 +85,21 @@ storiesOf('Card', module)
</div>

<div className="ray-card__content">
<h4 className="ray-text--h4">Nicolas Boer 399</h4>
<p>
<div className="ray-text--body-large">
<a href="javascript:;">Better Together</a>
</div>

<p className="ray-text--body">
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolorem
atque minima itaque sint! Doloremque odio quia saepe.
</p>

<button className="ray-button ray-button--primary ray-button--compact">
Sign Up Now
</button>
<button className="ray-button ray-button--secondary ray-button--compact">
Learn More
</button>
<button className="ray-button ray-button--tertiary ray-button--compact">
Share
</button>
</div>
</div>
))
.add('card, tertiary button', () => (
<div
className="ray-card"
style={{
maxWidth: '480px'
}}
>
<div className="ray-card__content">
<h4 className="ray-text--h4">Nicolas Boer 399</h4>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolorem
atque minima itaque sint! Doloremque odio quia saepe.
</p>
<button className="ray-button ray-button--tertiary ray-button--pull-left ray-button--compact">
Share
</button>
</div>
</div>
));

0 comments on commit 91666a3

Please sign in to comment.