Skip to content
This repository was archived by the owner on Dec 11, 2021. It is now read-only.

Commit 18ce6c7

Browse files
committed
Modals: Beta styling
1 parent eb90b06 commit 18ce6c7

File tree

5 files changed

+35
-5
lines changed

5 files changed

+35
-5
lines changed

demos/modals/modals.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
body {
2+
max-width: 900px;
3+
margin: 3em auto;
4+
padding: 0 1em;
5+
}

demos/modals/modals.html

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,28 @@
22
<html>
33
<head>
44
<meta charset="utf-8">
5-
<title>CSS Chassis - Typography</title>
5+
<title>CSS Chassis - Modal</title>
66
<meta name="description" content="Typography skeleton for styling">
77
<meta name="viewport" content="width=device-width, initial-scale=1">
8-
<link rel="stylesheet" href="../dist/css/chassis.css">
8+
<link rel="stylesheet" href="../../dist/css/chassis.css">
99
<link rel="stylesheet" href="modals.css">
10-
<link rel="stylesheet" href="../../external/Cayman_theme/cayman.css">
1110
<link href="http://fonts.googleapis.com/css?family=Open+Sans:400,600,700,400italic,700italic" rel="stylesheet">
1211
</head>
1312
<body>
1413
<section class="main-content">
15-
14+
<div class="modal">
15+
<div class="modal-header">
16+
<h4>Modal title</h4>
17+
</div>
18+
<div class="modal-body">
19+
Body
20+
</div>
21+
<div class="modal-footer">
22+
<button class="btn btn-default btn-md">Default</button>
23+
<button class="btn btn-primary btn-md">Primary</button>
24+
<button class="btn btn-success btn-md">Success</button>
25+
</div>
26+
</div>
1627
</section>
1728
</body>
1829
</html>

scss/atoms/modals/_mixins.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,22 @@
55
* ==========================================================================
66
*/
77

8+
$border-radius: map-get($modal-borders, radius);
9+
810
@mixin modal() {
911
padding: em(map-get($modal-element, padding));
1012
margin: em(map-get($modal-element, margin));
1113
background: map-get($modal-element, background);
1214
border: map-get($modal-borders, default);
15+
border-radius: $border-radius;
1316
box-shadow: map-get($modal-shadows, base);
1417
}
1518

1619
@mixin modal-header() {
1720
padding: em(map-get($modal-header, padding));
1821
margin: em(map-get($modal-header, margin));
1922
background: map-get($modal-header, background);
23+
border-radius: $border-radius $border-radius 0 0;
2024
}
2125

2226
@mixin modal-body() {
@@ -29,4 +33,6 @@
2933
padding: em(map-get($modal-header, padding));
3034
margin: em(map-get($modal-header, margin));
3135
background: map-get($modal-footer, background);
36+
border-radius: 0 0 $border-radius $border-radius;
37+
@include clearfix();
3238
}

scss/atoms/modals/_modals.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414

1515
.modal-header {
1616
@include modal-header();
17+
h4 {
18+
margin: 0;
19+
}
1720
}
1821

1922
.modal-body {
@@ -22,5 +25,9 @@
2225

2326
.modal-footer {
2427
@include modal-footer();
28+
@include clearfix();
29+
& .btn {
30+
float: right;
31+
}
2532
}
2633
}

scss/variables/modal.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ chassis.modal = {
2121
"borders": {
2222
name: "Modal border styles",
2323
value: {
24-
"default": "1px solid " + chassis.colors.grey.value.base
24+
"default": "1px solid " + chassis.colors.grey.value.base,
25+
"radius": "3px"
2526
}
2627
},
2728
"element": {

0 commit comments

Comments
 (0)