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

Commit 2711fa1

Browse files
committed
Modals: Removed cascading + new classes
Added new classes for buttons
1 parent 18ce6c7 commit 2711fa1

File tree

4 files changed

+59
-30
lines changed

4 files changed

+59
-30
lines changed

demos/modals/modals.html

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,16 @@
1313
<section class="main-content">
1414
<div class="modal">
1515
<div class="modal-header">
16-
<h4>Modal title</h4>
16+
<span class="modal-title">Modal title</span>
1717
</div>
1818
<div class="modal-body">
19-
Body
19+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras sed sapien quam. Sed dapibus est id enim facilisis, at posuere turpis adipiscing. Quisque sit amet dui dui. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras sed sapien quam. Sed dapibus est id enim facilisis, at posuere turpis adipiscing. Quisque sit amet dui dui.
20+
2021
</div>
2122
<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>
23+
<button class="btn btn-default btn-lg modal-btn-right">Default</button>
24+
<button class="btn btn-primary btn-lg modal-btn-left">Primary</button>
25+
<button class="btn btn-success btn-lg modal-btn-left">Success</button>
2526
</div>
2627
</div>
2728
</section>

scss/atoms/modals/_mixins.scss

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
* ==========================================================================
66
*/
77

8+
// Styles shared by modal's inner components
89
$border-radius: map-get($modal-borders, radius);
10+
$padding: em(map-get($modal-padding, padding));
911

1012
@mixin modal() {
1113
padding: em(map-get($modal-element, padding));
@@ -17,22 +19,29 @@ $border-radius: map-get($modal-borders, radius);
1719
}
1820

1921
@mixin modal-header() {
20-
padding: em(map-get($modal-header, padding));
22+
padding: $padding;
2123
margin: em(map-get($modal-header, margin));
2224
background: map-get($modal-header, background);
2325
border-radius: $border-radius $border-radius 0 0;
2426
}
2527

2628
@mixin modal-body() {
27-
padding: em(map-get($modal-header, padding));
29+
padding: 0 $padding;
2830
margin: em(map-get($modal-header, margin));
2931
background: map-get($modal-body, background);
32+
overflow-y: map-get($modal-body, overflow-y);
3033
}
3134

3235
@mixin modal-footer() {
33-
padding: em(map-get($modal-header, padding));
36+
padding: $padding;
3437
margin: em(map-get($modal-header, margin));
3538
background: map-get($modal-footer, background);
3639
border-radius: 0 0 $border-radius $border-radius;
3740
@include clearfix();
3841
}
42+
43+
@mixin modal-title() {
44+
font-size: em(map-get($modal-title, font-size));
45+
font-weight: map-get($modal-title, font-weight);
46+
margin: map-get($modal-title, margin);
47+
}

scss/atoms/modals/_modals.scss

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,30 @@
1111

1212
.modal {
1313
@include modal();
14+
}
15+
16+
.modal-header {
17+
@include modal-header();
18+
}
19+
20+
.modal-title {
21+
margin: 0;
22+
@include modal-title();
23+
}
24+
25+
.modal-body {
26+
@include modal-body();
27+
}
28+
29+
.modal-footer {
30+
@include modal-footer();
31+
@include clearfix();
32+
}
33+
34+
.modal-btn-left {
35+
float: left;
36+
}
1437

15-
.modal-header {
16-
@include modal-header();
17-
h4 {
18-
margin: 0;
19-
}
20-
}
21-
22-
.modal-body {
23-
@include modal-body();
24-
}
25-
26-
.modal-footer {
27-
@include modal-footer();
28-
@include clearfix();
29-
& .btn {
30-
float: right;
31-
}
32-
}
38+
.modal-btn-right {
39+
float: right;
3340
}

scss/variables/modal.js

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ chassis.modal = {
2525
"radius": "3px"
2626
}
2727
},
28+
"padding": {
29+
name: "Modal Padding value",
30+
value: {
31+
"padding": "15px"
32+
}
33+
},
2834
"element": {
2935
name: "Generic modal styles",
3036
value: {
@@ -33,26 +39,32 @@ chassis.modal = {
3339
"background": chassis.colors.background.value.base
3440
}
3541
},
42+
"title": {
43+
name: "Modal Title Styles",
44+
value: {
45+
"font-size": "24px",
46+
"font-weight": "700",
47+
"margin": "0"
48+
}
49+
},
3650
"header": {
3751
name: "Modal Header styles",
3852
value: {
39-
"padding": "12px",
4053
"margin": "0px",
4154
"background": chassis.colors.background.value.base
4255
}
4356
},
4457
"body": {
4558
name: "Modal Body styles",
4659
value: {
47-
"padding": "12px",
4860
"margin": "0px",
49-
"background": chassis.colors.background.value.base
61+
"background": chassis.colors.background.value.base,
62+
"overflow-y": "scroll"
5063
}
5164
},
5265
"footer": {
5366
name: "Modal Footer styles",
5467
value: {
55-
"padding": "12px",
5668
"margin": "0px",
5769
"background": chassis.colors.background.value.base
5870
}

0 commit comments

Comments
 (0)