Skip to content

Commit d83178c

Browse files
committed
Modal: convert Light DOM LESS to SCSS
1 parent 366d8cf commit d83178c

File tree

3 files changed

+20
-17
lines changed

3 files changed

+20
-17
lines changed

src/less/components.less

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
@import 'components/form/index';
3232
@import 'components/list/index';
3333
@import 'components/menu/index';
34-
@import 'components/modal/index';
3534
@import 'components/popover/index';
3635
@import 'components/radio/index';
3736
@import 'components/search/index';

src/scss/components/_index.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
@import "icon/index";
1010
@import "layout/index";
1111
@import "loader/index";
12+
@import "modal/index";
1213
@import "navigation/index";
1314
@import "pagination/index";
1415
@import "panel/index";

src/less/components/modal/index.less renamed to src/scss/components/modal/_index.scss

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
@import (reference) 'vars';
1+
@import "vars";
2+
@import "../config";
23

3-
hx-modal:extend(.hxComponent) {
4+
hx-modal {
5+
@extend %hxComponent;
46
display: none;
57
height: 100vh;
68
left: 0;
79
position: fixed;
810
top: 0;
911
width: 100vw;
10-
z-index: @modal-z-index;
12+
z-index: $modal-z-index;
1113

1214
&[open] {
1315
display: block;
@@ -20,7 +22,7 @@ hx-modal {
2022
flex-shrink: 0;
2123
line-height: 1;
2224
order: 1;
23-
padding: @space[md];
25+
padding: map-get($space, md);
2426

2527
// TODO: refactor this
2628
h1, h2, h3, h4, h5, h6 {
@@ -31,25 +33,26 @@ hx-modal {
3133
}
3234

3335
> hx-div {
34-
--hxPaddingLeft: @space[md];
35-
--hxPaddingRight: @space[md];
36+
--hxPaddingLeft: #{map-get($space, md)};
37+
--hxPaddingRight: #{map-get($space, md)};
38+
3639
flex-grow: 1;
3740
order: 2;
3841

39-
#HXDiv.shadyRoot({
40-
padding: 0 @space[md];
41-
});
42+
@include hxDiv-shadyRoot {
43+
padding: 0 map-get($space, md);
44+
};
4245

4346
&:first-child {
4447
margin-top: 4rem;
4548
}
4649

4750
&:last-child {
48-
--hxPaddingBottom: @space[md];
51+
--hxPaddingBottom: #{map-get($space, md)};
4952

50-
#HXDiv.shadyRoot({
51-
padding-bottom: @space[md];
52-
});
53+
@include hxDiv-shadyRoot {
54+
padding-bottom: map-get($space, md);
55+
};
5356
}
5457
}
5558

@@ -58,15 +61,15 @@ hx-modal {
5861
flex-shrink: 0;
5962
justify-content: center;
6063
order: 3;
61-
padding: @space[md];
64+
padding: map-get($space, md);
6265

6366
.hxBtn + .hxBtn {
64-
margin-left: @space[md];
67+
margin-left: map-get($space, md);
6568
}
6669
}
6770
}
6871

69-
/* ----- DEPRECATED: remove in v1.0.0 ----- */
72+
// ----- DEPRECATED: remove in v1.0.0 -----
7073
hx-modalbody {
7174
display: block;
7275
flex-grow: 1;

0 commit comments

Comments
 (0)