forked from canonical/vanilla-framework
-
Notifications
You must be signed in to change notification settings - Fork 1
/
_patterns_matrix.scss
142 lines (116 loc) · 3.01 KB
/
_patterns_matrix.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
@import 'settings';
// List Grid
@mixin vf-p-matrix {
$matrix-img-width: map-get($icon-sizes, heading-icon--small);
$matrix-img-gutter: $sph-outer;
.p-matrix {
display: flex;
flex-wrap: wrap;
list-style: none;
margin-bottom: $spv-outer--scaleable;
margin-left: 0;
padding-left: 0;
> p:last-child {
margin-bottom: $spv-nudge-compensation;
}
}
.p-matrix__item {
border-top: 1px solid $color-mid-light;
display: flex;
flex: 1 1 auto;
padding-bottom: $spv-inner--scaleable;
padding-top: calc(#{$spv-inner--scaleable} - 1px);
@media (min-width: $breakpoint-small) {
display: flex;
flex-wrap: wrap;
width: 33.333%;
}
@media (min-width: $breakpoint-small) and (max-width: $breakpoint-large) {
flex-direction: column;
}
@media (min-width: $breakpoint-medium) {
border-right: 1px solid $color-mid-light;
padding-left: $spv-inner--scaleable;
padding-right: $spv-inner--scaleable;
width: 33.333%;
&:empty {
display: block; // hide orphans
}
&:nth-child(3n + 1) {
padding-left: 0;
}
&:nth-child(3n + 3) {
border-right: 0;
}
&:nth-child(1),
&:nth-child(2),
&:nth-child(3) {
border-top: 0;
}
}
@media (min-width: $breakpoint-large) {
// 3 items per row
border-right: 1px solid $color-mid-light;
width: 33.333%;
&:empty {
display: block; // hide orphans
}
&:nth-child(3n + 1) {
padding-left: 0;
}
&:nth-child(3n + 3) {
border-right: 0;
padding-right: 0;
}
&:nth-last-child(1),
&:nth-last-child(2),
&:nth-last-child(3) {
border-bottom: 0;
}
}
}
.p-matrix__img {
align-self: flex-start;
flex-shrink: 0;
height: auto;
margin-bottom: $spv-inner--small;
margin-right: $matrix-img-gutter;
width: $matrix-img-width;
@media (max-width: $breakpoint-heading-threshold) {
margin-top: 0;
}
@media (min-width: $breakpoint-heading-threshold) {
margin-top: -#{map-get($nudges, nudge--h4)};
}
@if ($increase-font-size-on-larger-screens) {
@media (min-width: $breakpoint-x-large) {
margin-top: -#{map-get($nudges, nudge--h4-large)};
}
}
}
.p-matrix__content {
display: flex;
flex: 1 1 auto;
flex-direction: column;
padding-right: $sph-inner;
@media (min-width: $breakpoint-large) {
width: calc(100% - #{$matrix-img-width + $matrix-img-gutter});
}
}
.p-matrix__title {
@extend %vf-heading-4;
@media (min-width: $breakpoint-heading-threshold) {
margin-bottom: -#{map-get($nudges, nudge--h4)};
}
@if ($increase-font-size-on-larger-screens) {
@media (min-width: $breakpoint-x-large) {
margin-bottom: -#{map-get($nudges, nudge--h4-large)};
}
}
}
.p-matrix__desc {
@media (max-width: $breakpoint-heading-threshold) {
margin-top: -#{$sp-unit};
}
}
}