File tree Expand file tree Collapse file tree 4 files changed +124
-0
lines changed Expand file tree Collapse file tree 4 files changed +124
-0
lines changed Original file line number Diff line number Diff line change 14
14
@import 'layout.css' ;
15
15
@import 'grid.css' ;
16
16
@import 'icon.css' ;
17
+ @import 'well.css' ;
17
18
@import 'background-shapes.css' ;
18
19
19
20
/* Components */
Original file line number Diff line number Diff line change @@ -149,6 +149,18 @@ strong {
149
149
font-weight : var (--font-weight-3 );
150
150
}
151
151
152
+ figure ,
153
+ figcaption {
154
+ display : block;
155
+ margin : 0 ;
156
+ padding : 0 ;
157
+ }
158
+
159
+ figcaption {
160
+ margin-top : var (--spacing-1 );
161
+ color : var (--color-gray-600 );
162
+ }
163
+
152
164
/*
153
165
@media (max-width: 1280px) and (min-width: 421px) {
154
166
body,
Original file line number Diff line number Diff line change
1
+ .well {
2
+ display : flex;
3
+ height : 100% ;
4
+ box-sizing : border-box;
5
+ background : var (--color-white );
6
+ border-radius : var (--radius-lg );
7
+ border : 2px solid var (--color-gray-200 );
8
+ overflow : hidden;
9
+ }
10
+
11
+ a .well : focus {
12
+ border-color : var (--color-white );
13
+ }
14
+
15
+ a .well : hover {
16
+ border-color : var (--color-gray-300 );
17
+ }
18
+
19
+ .well img {
20
+ display : block;
21
+ margin : auto;
22
+ }
23
+
24
+ [class *= 'well-' ] {
25
+ position : relative;
26
+ height : 0 ;
27
+ }
28
+
29
+ .well-1\/ 1 {
30
+ padding : 0 0 100% ;
31
+ }
32
+
33
+ .well-4\/ 3 {
34
+ padding : 0 0 75% ;
35
+ }
36
+
37
+ .well-16\/ 9 {
38
+ padding : 0 0 56.25% ;
39
+ }
40
+
41
+ [class *= 'well-' ] img {
42
+ position : absolute;
43
+ top : 50% ;
44
+ left : 50% ;
45
+ max-width : calc (100% - 2 * var (--spacing-3 ));
46
+ max-height : calc (100% - 2 * var (--spacing-3 ));
47
+ transform : translate (-50% , -50% );
48
+ }
Original file line number Diff line number Diff line change
1
+ # Wells
2
+
3
+ Wells provide a box to wrap images that should be presented on a background, most likely because they have transparency.
4
+
5
+ ``` html
6
+ <!-- Note: p-2 and m-2 are spacer helpers and not relevant to the example -->
7
+ <div class =" well p-2 m-2" >
8
+ Hello World
9
+ </div >
10
+ ```
11
+
12
+ They also come in multiple ratios and ensure that a contained image is resized to fill the space appropriatly.
13
+
14
+ ``` html
15
+ <div class =" layout" >
16
+ <div class =" sm:col-2 lg:col-2 p-2" >
17
+ <h3 >Ratio 1:1</h3 >
18
+ <div class =" well well-1/1" >
19
+ <img src =" /ember-logo.png" alt =" Ember.js" />
20
+ </div >
21
+ </div >
22
+ <div class =" sm:col-2 lg:col-2 p-2" >
23
+ <h3 >Ratio 4:3</h3 >
24
+ <div class =" well well-4/3" >
25
+ <img src =" /ember-logo.png" alt =" Ember.js" />
26
+ </div >
27
+ </div >
28
+ <div class =" sm:col-2 lg:col-2 p-2" >
29
+ <h3 >Ratio 16:9</h3 >
30
+ <div class =" well well-16/9" >
31
+ <img src =" /ember-logo.png" alt =" Ember.js" />
32
+ </div >
33
+ </div >
34
+ </div >
35
+ ```
36
+
37
+ Wells can be applied to anchors and work well with HTML ` <figure> ` elements.
38
+
39
+ ``` html
40
+ <div class =" layout" >
41
+ <div class =" sm:col-2 lg:col-2 p-2" >
42
+ <figure >
43
+ <div class =" well well-16/9" >
44
+ <img src =" /ember-logo.png" alt =" Ember.js" />
45
+ </div >
46
+ <figcaption >
47
+ A well thought out caption to add more information to the image above
48
+ </figcaption >
49
+ </figure >
50
+ </div >
51
+ <div class =" sm:col-2 lg:col-2 p-2" >
52
+ <figure >
53
+ <a href =" #" class =" well well-16/9" >
54
+ <img src =" /ember-logo.png" alt =" Ember.js" />
55
+ </a >
56
+ <figcaption >
57
+ Using an anchor for the well works, too. You may want to add an additional link to the text
58
+ and or make sure this becomes clear from the context.
59
+ </figcaption >
60
+ </figure >
61
+ </div >
62
+ </div >
63
+ ```
You can’t perform that action at this time.
0 commit comments