@uqds/card 0.1.3 → 0.1.4-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/main.css +1 -1
- package/package.json +5 -5
- package/src/scss/_card.scss +12 -4
- package/src/scss/_story-card.scss +126 -46
package/dist/css/main.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--card-title-font-size: 24px}@media(max-width: 37.4375rem){:root{--card-title-font-size: 22px}}.uq-card,.uq-story-card{position:relative;display:flex;flex-direction:column;border-radius:4px;border:1px solid #dcdcdd;background:#fff}.uq-card:has(a:focus-visible),.uq-story-card:has(a:focus-visible){outline:4px solid #0d6dcd;outline-offset:-1px}.uq-card:has(a:hover),.uq-story-card:has(a:hover){background:#f3f3f4}.uq-card:has(a:hover) .uq-card__content::after,.uq-story-card:has(a:hover) .uq-card__content::after{left:8px}.uq-card__content{flex:1;display:flex;flex-direction:column;padding:1.5rem}.uq-card__content::after{content:"";height:calc(24px + 1.5rem);width:24px;margin-top:auto;position:relative;background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M4 12h15M14 18l6-6-6-6' stroke='%2351247a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3c/path%3e%3c/svg%3e");background-position:right bottom;background-size:24px;background-repeat:no-repeat;transition:left 200ms ease-in-out;left:0}.uq-card__title,.uq-story-card__title{margin:0;color:#19151c;font-size:var(--card-title-font-size)}.uq-card__title a,.uq-story-card__title a{color:#19151c;text-decoration:none;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:5;overflow:hidden}.uq-card__title a::after,.uq-story-card__title a::after{content:"";position:absolute;inset:0}.uq-card__title a:focus,.uq-story-card__title a:focus{outline:none}.uq-card__title a:hover,.uq-story-card__title a:hover{color:#19151c;text-decoration:underline;background-color:rgba(0,0,0,0)}.uq-card__description,.uq-story-card__description{margin-top:.5rem}.uq-card__image,.uq-story-card__image{aspect-ratio:1.5/1;position:relative;flex-shrink:0}.uq-card__image img,.uq-
|
|
1
|
+
:root{--card-title-font-size: 24px}@media(max-width: 37.4375rem){:root{--card-title-font-size: 22px}}.uq-card,.uq-story-card{position:relative;display:flex;flex-direction:column;border-radius:4px;border:1px solid #dcdcdd;background:#fff}.uq-card:has(a:focus-visible),.uq-story-card:has(a:focus-visible){outline:4px solid #0d6dcd;outline-offset:-1px}.uq-card:has(a:hover),.uq-story-card:has(a:hover){background:#f3f3f4}.uq-card:has(a:hover) .uq-card__content::after,.uq-story-card:has(a:hover) .uq-card__content::after{left:8px}.uq-card__content{flex:1;display:flex;flex-direction:column;padding:1.5rem}.uq-card__content::after{content:"";height:calc(24px + 1.5rem);width:24px;margin-top:auto;position:relative;background-image:url("data:image/svg+xml,%3csvg viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M4 12h15M14 18l6-6-6-6' stroke='%2351247a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3c/path%3e%3c/svg%3e");background-position:right bottom;background-size:24px;background-repeat:no-repeat;transition:left 200ms ease-in-out;left:0}.uq-card__title,.uq-story-card__title{margin:0;color:#19151c;font-size:var(--card-title-font-size)}.uq-card__title a,.uq-story-card__title a{color:#19151c;text-decoration:none;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:5;overflow:hidden}.uq-card__title a::after,.uq-story-card__title a::after{content:"";position:absolute;inset:0}.uq-card__title a:focus,.uq-story-card__title a:focus{outline:none}.uq-card__title a:hover,.uq-story-card__title a:hover{color:#19151c;text-decoration:underline;background-color:rgba(0,0,0,0)}.uq-card__description,.uq-story-card__description{margin-top:.5rem;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4;overflow:hidden}.uq-card__image,.uq-story-card__image{aspect-ratio:1.5/1;position:relative;flex-shrink:0}.uq-card__image img,.uq-card__image picture,.uq-story-card__image img,.uq-story-card__image picture{width:100%;height:100%;inset:0;position:absolute;object-fit:cover}.uq-card__icon{margin-bottom:.5rem}.uq-card__icon .uq-icon::before{height:56px;width:56px}.uq-card--text .uq-card__image,.uq-card--text .uq-card__icon{display:none}.uq-card--image .uq-card__icon{display:none}.uq-card--icon .uq-card__image,.uq-card--icon-nav .uq-card__image{display:none}@media(max-width: 37.4375rem){.uq-card--icon-nav .uq-card__content{display:flex;align-items:center;flex-direction:row}.uq-card--icon-nav .uq-card__content::after{height:24px;width:calc(24px + 1rem);margin-top:0;margin-left:auto;padding-left:1rem;flex-shrink:0}.uq-card--icon-nav .uq-card__description{display:none}.uq-card--icon-nav .uq-card__icon{margin:0 1rem 0 0}.uq-card--icon-nav .uq-card__icon .uq-icon::before{height:40px;width:40px}}@container (width > 667px){.uq-card-grid--target-1x .uq-card{display:flex;flex-direction:row-reverse;gap:var(--layout-gap);align-items:center}.uq-card-grid--target-1x .uq-card__image{width:50%;height:100%}.uq-card-grid--target-1x .uq-card__content{width:50%;padding-inline:1.5rem 0}}.uq-story-card__content{flex:1;display:flex;flex-direction:column;padding:1.5rem}.uq-story-card__top-label{margin-bottom:.25rem;color:#757377;font-weight:500}.uq-story-card__bottom-label{padding-top:1.5rem;margin-top:auto}@media(max-width: 37.4375rem){.uq-story-card:not(.uq-story-card--feature){border-radius:0;border-inline-width:0;border-top-width:0;display:flex;flex-direction:row-reverse;align-items:start;gap:1rem;padding-bottom:1rem;background-color:rgba(0,0,0,0)}.uq-story-card:not(.uq-story-card--feature):has(a:hover){background-color:rgba(0,0,0,0)}.uq-story-card:not(.uq-story-card--feature) .uq-story-card__content{padding:0}.uq-story-card:not(.uq-story-card--feature) .uq-story-card__image{width:120px;height:100px;aspect-ratio:unset;flex-shrink:0;margin-top:6px}.uq-story-card:not(.uq-story-card--feature) .uq-story-card__description{display:none}.uq-story-card:not(.uq-story-card--feature) .uq-story-card__top-label{margin-bottom:0}.uq-story-card:not(.uq-story-card--feature) .uq-story-card__bottom-label{padding-top:.5rem}}.uq-card-grid--target-1x .uq-story-card .uq-story-card__description{display:-webkit-box}@container (width > 667px){.uq-card-grid--target-1x .uq-story-card:not(.uq-story-card--feature){display:flex;flex-direction:row-reverse;gap:var(--layout-gap);align-items:center}.uq-card-grid--target-1x .uq-story-card:not(.uq-story-card--feature) .uq-story-card__image{width:50%;height:100%}.uq-card-grid--target-1x .uq-story-card:not(.uq-story-card--feature) .uq-story-card__content{width:50%;padding-inline:1.5rem 0}}.uq-story-card--event .uq-story-card__top-label{color:#51247a}.uq-story-card--event .uq-story-card__description,.uq-story-card--story .uq-story-card__description{display:none}.uq-story-card--feature .uq-story-card__title{font-size:2rem}@media(max-width: 37.4375rem){.uq-story-card--feature .uq-story-card__title{font-size:var(--card-title-font-size)}}.uq-story-card--feature .uq-story-card__description{display:-webkit-box}.uq-story-card--landscape{border-radius:0;border-inline-width:0;border-top-width:0;display:flex;flex-direction:row-reverse;align-items:start;gap:1rem;padding-bottom:1rem;background-color:rgba(0,0,0,0)}.uq-story-card--landscape:has(a:hover){background-color:rgba(0,0,0,0)}.uq-story-card--landscape .uq-story-card__content{padding:0}.uq-story-card--landscape .uq-story-card__image{width:227px;height:138px;aspect-ratio:unset;flex-shrink:0;margin-top:6px}@container (width < 600px){.uq-story-card--landscape .uq-story-card__image{width:120px;height:100px}}.uq-story-card--landscape .uq-story-card__image:not(:has(img)){background-color:#e8e8e8;background-image:url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%238c8a8d'%3e%3cg fill='none' stroke='%238c8a8d' stroke-linecap='round' stroke-linejoin='round' stroke-width='.75'%3e%3cpath d='M8 13.6V3.86S6.63 2.34 2 2.29a.25.25 0 0 0-.2.08.25.25 0 0 0-.09.2v9.14c0 .15.12.29.29.29 4.63.09 6 1.6 6 1.6zM6.31 7.48a12.9 12.9 0 0 0-2.94-.6m2.94 2.95c-.94-.31-1.94-.52-2.94-.6m6.32-1.75a12.9 12.9 0 0 1 2.94-.6M9.69 9.83c.94-.31 1.94-.52 2.94-.6'%3e%3c/path%3e%3cpath d='M8 13.6V3.86s1.37-1.52 6-1.57c.09 0 .14.02.2.08s.09.11.09.2v9.14c0 .15-.12.29-.29.29-4.63.09-6 1.6-6 1.6zm0 0'%3e%3c/path%3e%3c/g%3e%3c/svg%3e");background-size:88px;background-position:center;background-repeat:no-repeat}.uq-story-card--landscape .uq-story-card__description{display:none}.uq-story-card--landscape .uq-story-card__top-label{margin-bottom:0}.uq-story-card--landscape .uq-story-card__bottom-label{padding-top:.5rem}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uqds/card",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4-alpha.1",
|
|
4
4
|
"description": "Card components",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"uqds",
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
"url": "https://github.com/uq-its-ss/design-system/issues"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@uqds/core": "^1.2.
|
|
45
|
-
"@uqds/icon": "^0.0.
|
|
46
|
-
"@uqds/layout": "^1.0.
|
|
44
|
+
"@uqds/core": "^1.2.4-alpha.0",
|
|
45
|
+
"@uqds/icon": "^0.0.19-alpha.1",
|
|
46
|
+
"@uqds/layout": "^1.1.0-alpha.0"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "63ecc577f4c2cd3cecc99ba7990d6aec117eeaad"
|
|
49
49
|
}
|
package/src/scss/_card.scss
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
@use "@uqds/icon/src/scss/global" as icon;
|
|
3
3
|
@use "@uqds/layout/src/scss/global" as layout;
|
|
4
4
|
|
|
5
|
-
.uq-card
|
|
5
|
+
.uq-card,
|
|
6
|
+
%uq-card {
|
|
6
7
|
position: relative;
|
|
7
8
|
display: flex;
|
|
8
9
|
flex-direction: column;
|
|
@@ -48,7 +49,8 @@
|
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
51
|
|
|
51
|
-
.uq-card__title
|
|
52
|
+
.uq-card__title,
|
|
53
|
+
%uq-card__title {
|
|
52
54
|
margin: 0;
|
|
53
55
|
color: core.$black;
|
|
54
56
|
font-size: var(--card-title-font-size);
|
|
@@ -79,11 +81,17 @@
|
|
|
79
81
|
}
|
|
80
82
|
}
|
|
81
83
|
|
|
82
|
-
.uq-card__description
|
|
84
|
+
.uq-card__description,
|
|
85
|
+
%uq-card__description {
|
|
83
86
|
margin-top: core.$space-s;
|
|
87
|
+
display: -webkit-box;
|
|
88
|
+
-webkit-box-orient: vertical;
|
|
89
|
+
-webkit-line-clamp: 4;
|
|
90
|
+
overflow: hidden;
|
|
84
91
|
}
|
|
85
92
|
|
|
86
|
-
.uq-card__image
|
|
93
|
+
.uq-card__image,
|
|
94
|
+
%uq-card__image {
|
|
87
95
|
aspect-ratio: 1.5 / 1;
|
|
88
96
|
position: relative;
|
|
89
97
|
flex-shrink: 0;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
@use "@uqds/core/src/scss/global" as core;
|
|
2
2
|
@use "@uqds/layout/src/scss/global" as layout;
|
|
3
|
+
@use "@uqds/icon/src/scss/global" as icon-constants;
|
|
3
4
|
@use "card";
|
|
4
5
|
|
|
6
|
+
$story-card-small-container: 600px;
|
|
7
|
+
|
|
5
8
|
.uq-story-card {
|
|
6
|
-
@extend
|
|
9
|
+
@extend %uq-card;
|
|
7
10
|
}
|
|
8
11
|
|
|
9
12
|
.uq-story-card__content {
|
|
@@ -14,11 +17,11 @@
|
|
|
14
17
|
}
|
|
15
18
|
|
|
16
19
|
.uq-story-card__title {
|
|
17
|
-
@extend
|
|
20
|
+
@extend %uq-card__title;
|
|
18
21
|
}
|
|
19
22
|
|
|
20
23
|
.uq-story-card__description {
|
|
21
|
-
@extend
|
|
24
|
+
@extend %uq-card__description;
|
|
22
25
|
}
|
|
23
26
|
|
|
24
27
|
.uq-story-card__top-label {
|
|
@@ -33,41 +36,30 @@
|
|
|
33
36
|
}
|
|
34
37
|
|
|
35
38
|
.uq-story-card__image {
|
|
36
|
-
@extend
|
|
39
|
+
@extend %uq-card__image;
|
|
37
40
|
}
|
|
38
41
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
}
|
|
42
|
+
/**
|
|
43
|
+
* Mobile landscape/listing display.
|
|
44
|
+
*/
|
|
44
45
|
|
|
45
|
-
.uq-story-card--
|
|
46
|
-
.uq-story-card--story {
|
|
47
|
-
.uq-story-card__description {
|
|
48
|
-
display: none;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.uq-card-grid:not(.uq-card-grid--target-1x) {
|
|
46
|
+
.uq-story-card:not(.uq-story-card--feature) {
|
|
53
47
|
@media #{core.$screen-md-down} {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
48
|
+
border-radius: 0;
|
|
49
|
+
border-inline-width: 0;
|
|
50
|
+
border-top-width: 0;
|
|
51
|
+
display: flex;
|
|
52
|
+
flex-direction: row-reverse;
|
|
53
|
+
align-items: start;
|
|
54
|
+
gap: core.$space-m;
|
|
55
|
+
padding-bottom: core.$space-m;
|
|
56
|
+
background-color: transparent;
|
|
57
|
+
|
|
58
|
+
&:has(a:hover) {
|
|
63
59
|
background-color: transparent;
|
|
64
|
-
|
|
65
|
-
&:hover {
|
|
66
|
-
background-color: transparent;
|
|
67
|
-
}
|
|
68
60
|
}
|
|
69
61
|
|
|
70
|
-
.uq-story-card__content {
|
|
62
|
+
& .uq-story-card__content {
|
|
71
63
|
padding: 0;
|
|
72
64
|
}
|
|
73
65
|
|
|
@@ -76,49 +68,137 @@
|
|
|
76
68
|
height: 100px;
|
|
77
69
|
aspect-ratio: unset;
|
|
78
70
|
flex-shrink: 0;
|
|
71
|
+
margin-top: 6px;
|
|
79
72
|
}
|
|
80
73
|
|
|
81
|
-
.uq-story-
|
|
82
|
-
-webkit-line-clamp: 3;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.uq-story-card__description {
|
|
74
|
+
& .uq-story-card__description {
|
|
86
75
|
display: none;
|
|
87
76
|
}
|
|
88
77
|
|
|
89
|
-
.uq-story-card__top-label {
|
|
78
|
+
& .uq-story-card__top-label {
|
|
90
79
|
margin-bottom: 0;
|
|
91
80
|
}
|
|
92
81
|
|
|
93
|
-
.uq-story-card__bottom-label {
|
|
82
|
+
& .uq-story-card__bottom-label {
|
|
94
83
|
padding-top: core.$space-s;
|
|
95
84
|
}
|
|
96
85
|
}
|
|
97
86
|
}
|
|
98
87
|
|
|
88
|
+
/**
|
|
89
|
+
* Side by side for card-grid 1x layouts.
|
|
90
|
+
*/
|
|
91
|
+
|
|
99
92
|
.uq-card-grid--target-1x {
|
|
100
93
|
& .uq-story-card {
|
|
101
94
|
& .uq-story-card__description {
|
|
102
|
-
display:
|
|
95
|
+
display: -webkit-box;
|
|
103
96
|
}
|
|
104
97
|
}
|
|
105
98
|
|
|
106
99
|
@container (width > #{layout.$card-grid-container-md}) {
|
|
107
|
-
& .uq-story-card {
|
|
100
|
+
& .uq-story-card:not(.uq-story-card--feature) {
|
|
108
101
|
display: flex;
|
|
109
102
|
flex-direction: row-reverse;
|
|
110
103
|
gap: var(--layout-gap);
|
|
111
104
|
align-items: center;
|
|
105
|
+
|
|
106
|
+
& .uq-story-card__image {
|
|
107
|
+
width: 50%;
|
|
108
|
+
height: 100%;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
& .uq-story-card__content {
|
|
112
|
+
width: 50%;
|
|
113
|
+
padding-inline: core.$space-l 0;
|
|
114
|
+
}
|
|
112
115
|
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
113
118
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
119
|
+
/**
|
|
120
|
+
* Variants
|
|
121
|
+
*/
|
|
122
|
+
|
|
123
|
+
.uq-story-card--event {
|
|
124
|
+
& .uq-story-card__top-label {
|
|
125
|
+
color: core.$purple-500;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.uq-story-card--event,
|
|
130
|
+
.uq-story-card--story {
|
|
131
|
+
.uq-story-card__description {
|
|
132
|
+
display: none;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.uq-story-card--feature {
|
|
137
|
+
.uq-story-card__title {
|
|
138
|
+
font-size: core.$font-size-xxxl;
|
|
139
|
+
|
|
140
|
+
@media #{core.$screen-md-down} {
|
|
141
|
+
font-size: var(--card-title-font-size);
|
|
117
142
|
}
|
|
143
|
+
}
|
|
118
144
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
145
|
+
& .uq-story-card__description {
|
|
146
|
+
display: -webkit-box;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.uq-story-card--landscape {
|
|
151
|
+
border-radius: 0;
|
|
152
|
+
border-inline-width: 0;
|
|
153
|
+
border-top-width: 0;
|
|
154
|
+
display: flex;
|
|
155
|
+
flex-direction: row-reverse;
|
|
156
|
+
align-items: start;
|
|
157
|
+
gap: core.$space-m;
|
|
158
|
+
padding-bottom: core.$space-m;
|
|
159
|
+
background-color: transparent;
|
|
160
|
+
|
|
161
|
+
&:has(a:hover) {
|
|
162
|
+
background-color: transparent;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
& .uq-story-card__content {
|
|
166
|
+
padding: 0;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
& .uq-story-card__image {
|
|
170
|
+
width: 227px;
|
|
171
|
+
height: 138px;
|
|
172
|
+
aspect-ratio: unset;
|
|
173
|
+
flex-shrink: 0;
|
|
174
|
+
margin-top: 6px;
|
|
175
|
+
|
|
176
|
+
@container (width < #{$story-card-small-container}) {
|
|
177
|
+
width: 120px;
|
|
178
|
+
height: 100px;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
&:not(:has(img)) {
|
|
182
|
+
background-color: core.$grey-100;
|
|
183
|
+
background-image: url(icon-constants.get-icon(
|
|
184
|
+
"how-youll-learn--book-open-text",
|
|
185
|
+
core.$grey-600
|
|
186
|
+
));
|
|
187
|
+
background-size: 88px;
|
|
188
|
+
background-position: center;
|
|
189
|
+
background-repeat: no-repeat;
|
|
122
190
|
}
|
|
123
191
|
}
|
|
192
|
+
|
|
193
|
+
& .uq-story-card__description {
|
|
194
|
+
display: none;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
& .uq-story-card__top-label {
|
|
198
|
+
margin-bottom: 0;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
& .uq-story-card__bottom-label {
|
|
202
|
+
padding-top: core.$space-s;
|
|
203
|
+
}
|
|
124
204
|
}
|