Skip to content

Commit 96301d8

Browse files
adamraiderAdam Raider
authored andcommitted
fix: Typography classes (#21)
* fix: Typography classes * dynamic extend class * Update stories/grid.stories.js Co-Authored-By: adamraider <adamjraider@gmail.com> * update copy * remove duplicate story
1 parent b73ac87 commit 96301d8

File tree

3 files changed

+84
-42
lines changed

3 files changed

+84
-42
lines changed

packages/ray/lib/_tabs.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ $tabs-border-size: 1px;
55
display: flex;
66

77
&__item {
8-
@extend .p3;
8+
@extend .#{$prefix}p3;
99
display: block;
1010
cursor: pointer;
1111
color: $color-blue50;

packages/ray/lib/global/_typography.scss

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,65 +4,65 @@ h3,
44
h4,
55
h5,
66
h6,
7-
.#{$prefix}--h1,
8-
.#{$prefix}--h2,
9-
.#{$prefix}--h3,
10-
.#{$prefix}--h4,
11-
.#{$prefix}--h5,
12-
.#{$prefix}--h6 {
7+
.#{$prefix}h1,
8+
.#{$prefix}h2,
9+
.#{$prefix}h3,
10+
.#{$prefix}h4,
11+
.#{$prefix}h5,
12+
.#{$prefix}h6 {
1313
font-weight: bold;
1414
margin: 0;
1515
}
1616

1717
.h1,
18-
.#{$prefix}--h1 {
18+
.#{$prefix}h1 {
1919
font-size: 4rem;
2020
line-height: 96px;
2121
margin-bottom: 1.5rem;
2222
}
2323

2424
.h2,
25-
.#{$prefix}--h2 {
25+
.#{$prefix}h2 {
2626
font-size: 3rem;
2727
line-height: 72px;
2828
margin-bottom: 1rem;
2929
}
3030

3131
.h3,
32-
.#{$prefix}--h3 {
32+
.#{$prefix}h3 {
3333
font-size: 2.5rem;
3434
line-height: 60px;
3535
margin-bottom: 1rem;
3636
}
3737

3838
.h4,
39-
.#{$prefix}--h4 {
39+
.#{$prefix}h4 {
4040
font-size: 2rem;
4141
line-height: 56px;
4242
margin-bottom: 1rem;
4343
}
4444

4545
.h5,
46-
.#{$prefix}--h5 {
46+
.#{$prefix}h5 {
4747
font-size: 1.5rem;
4848
line-height: 40px;
4949
margin-bottom: 0.5rem;
5050
}
5151

5252
.h6,
53-
.#{$prefix}--h6 {
53+
.#{$prefix}h6 {
5454
font-size: 1.25rem;
5555
line-height: 40px;
5656
margin-bottom: 0.5rem;
5757
}
5858

5959
p,
60-
.p1,
61-
.p2,
62-
.p3,
63-
.p4,
64-
.p5,
65-
.p6 {
60+
.#{$prefix}p1,
61+
.#{$prefix}p2,
62+
.#{$prefix}p3,
63+
.#{$prefix}p4,
64+
.#{$prefix}p5,
65+
.#{$prefix}p6 {
6666
font-weight: 400;
6767
margin: 0;
6868
}
@@ -73,32 +73,32 @@ p {
7373
}
7474
}
7575

76-
.p1 {
76+
.#{$prefix}p1 {
7777
font-size: 2rem;
7878
line-height: 48px;
7979
}
8080

81-
.p2 {
81+
.#{$prefix}p2 {
8282
font-size: 1.5rem;
8383
line-height: 40px;
8484
}
8585

86-
.p3 {
86+
.#{$prefix}p3 {
8787
font-size: 1.25rem;
8888
line-height: 32px;
8989
}
9090

91-
.p4 {
91+
.#{$prefix}p4 {
9292
font-size: 1rem;
9393
line-height: 28px;
9494
}
9595

96-
.p5 {
96+
.#{$prefix}p5 {
9797
font-size: 0.875rem;
9898
line-height: 24px;
9999
}
100100

101-
.p6 {
101+
.#{$prefix}p6 {
102102
font-size: 0.75rem;
103103
line-height: 12px;
104104
}

packages/ray/stories/grid.stories.js

Lines changed: 59 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,69 @@ import React from 'react';
22
import { storiesOf } from '@storybook/react';
33
import { throttle, range } from 'lodash';
44
import withPadding from './util/withPadding';
5+
import { relative } from 'upath';
56

6-
storiesOf('Grid', module).addWithJSX('default', () => (
7-
<div style={{ backgroundColor: 'hsl(144, 100%, 75%)' }}>
8-
<div className="ray--grid">
9-
<div
10-
className="ray--grid__inner"
11-
style={{ backgroundColor: 'hsl(0, 100%, 75%)' }}
12-
>
13-
{range(12).map(n => (
14-
<div className="ray--grid__cell--span-1">
7+
storiesOf('Grid', module)
8+
.addWithJSX('default', () => (
9+
<div style={{ backgroundColor: 'hsl(144, 100%, 75%)' }}>
10+
<div className="ray--grid">
11+
<div
12+
className="ray--grid__inner"
13+
style={{ backgroundColor: 'hsl(0, 100%, 75%)' }}
14+
>
15+
{range(12).map(n => (
16+
<div className="ray--grid__cell--span-1">
17+
<div
18+
style={{
19+
minHeight: '4vh',
20+
backgroundColor: 'hsl(255, 100%, 75%)'
21+
}}
22+
>
23+
{n + 1}
24+
</div>
25+
</div>
26+
))}
27+
</div>
28+
</div>
29+
</div>
30+
))
31+
.addWithJSX('overlap', () => (
32+
<div style={{ backgroundColor: 'hsl(144, 100%, 75%)' }}>
33+
<div className="ray--grid">
34+
<div
35+
className="ray--grid__inner"
36+
style={{
37+
alignItems: 'center'
38+
}}
39+
>
40+
<div
41+
className="ray--grid__cell--span-4"
42+
style={{
43+
zIndex: '1',
44+
gridColumnStart: '1',
45+
gridRow: '1'
46+
}}
47+
>
48+
<div className="ray--h3">
49+
Each element needs `grid-column-start` & `grid-row: 1` defined for
50+
overlapping containers. :)
51+
</div>
52+
</div>
53+
<div
54+
className="ray--grid__cell--span-10"
55+
style={{
56+
gridColumnStart: '3',
57+
gridRow: '1'
58+
}}
59+
>
1560
<div
61+
className="Background--16by9"
1662
style={{
17-
minHeight: '4vh',
18-
backgroundColor: 'hsl(255, 100%, 75%)'
63+
backgroundImage: `url(//cdn.wework.com/6vy33zo2mgy3/2C7F8u8yfW4kKAI6OUa0a2/aae67b57aa0e7a26fcc84c561e823ee8/1_Web_150DPI-20180717_WeWork_Constellation_-_Common_Areas_-_Internal_Staircase.jpg?auto=compress&faces=false&w=1000&fit=crop&dpr=2&h=)`
1964
}}
20-
>
21-
{n + 1}
22-
</div>
65+
/>
2366
</div>
24-
))}
67+
</div>
2568
</div>
2669
</div>
27-
</div>
28-
));
70+
));

0 commit comments

Comments
 (0)