Skip to content

Commit a39317b

Browse files
committed
Menu: convert Light DOM LESS to SCSS
1 parent df6ce6d commit a39317b

File tree

6 files changed

+28
-28
lines changed

6 files changed

+28
-28
lines changed

docs/components/_index.scss

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
// load styles required to demonstrate each component
2-
1+
/// load styles required to demonstrate each component
32
@import "grid/index";
43
@import "typography/index";
4+
5+
/// load styles needed to test component visuals
6+
@import "menu/spec";

docs/styles/spec/menu-positioning-spec.less renamed to docs/components/menu/_spec.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.menu-positioning-spec {
22
[id^="target"] {
33
align-items: center;
4-
background-color: @gray-300;
4+
background-color: $gray-300;
55
display: flex;
66
height: 6rem;
77
justify-content: center;

docs/docs.less

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,6 @@ min-version {
317317
@import 'spec/choice-tile-spec';
318318
@import 'spec/dropdown-select-spec';
319319
@import 'spec/file-input-spec';
320-
@import 'spec/menu-positioning-spec';
321320
@import 'spec/panel-spec';
322321
@import 'spec/popover-spec';
323322
@import 'spec/radio-spec';

src/less/components.less

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
@import 'components/file/index';
3131
@import 'components/form/index';
3232
@import 'components/list/index';
33-
@import 'components/menu/index';
3433
@import 'components/popover/index';
3534
@import 'components/radio/index';
3635
@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 "menu/index";
1213
@import "modal/index";
1314
@import "navigation/index";
1415
@import "pagination/index";

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

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,27 @@
1-
@import (reference) 'mixins';
2-
@import (reference) 'components/box/index';
3-
4-
hx-menu:extend(.hxComponent) {
5-
#Positionable.base();
6-
7-
background-color: @gray-0;
8-
border: 1px solid @gray-300;
9-
box-shadow: @layering-shadow;
1+
@import "mixins";
2+
@import "../config";
3+
@import "components/box/config";
4+
5+
hx-menu {
6+
@extend %hxComponent;
7+
@include is-positionable;
8+
background-color: $gray-0;
9+
border: 1px solid $gray-300;
10+
box-shadow: $layering-shadow;
1011
max-width: 20rem;
1112
min-width: 10rem;
12-
z-index: @menu-z-index;
13+
z-index: $menu-z-index;
1314

1415
&[open] {
15-
#Box.sm();
16+
@include box-size(sm);
1617
display: block;
1718
}
1819

1920
> section {
2021
display: block;
2122

2223
header {
23-
color: @gray-600;
24+
color: $gray-600;
2425
font-size: 0.875rem;
2526
font-weight: 500;
2627
text-transform: uppercase;
@@ -32,18 +33,16 @@ hx-menu:extend(.hxComponent) {
3233
}
3334
}
3435

35-
/*
36-
Most of the styles mimic those of .hxBtn.hxLink.
36+
// Most of the styles mimic those of .hxBtn.hxLink.
3737

38-
However, because the generated CSS would end up being
39-
equally specific, extended definitions seem to take
40-
priority, so we can't use &:extend() here.
41-
*/
38+
// However, because the generated CSS would end up being
39+
// equally specific, extended definitions seem to take
40+
// priority, so we can't use @extend here.
4241
hx-menuitem {
4342
background-color: transparent;
4443
border-radius: 2px;
4544
border: none;
46-
color: @cyan-900;
45+
color: $cyan-900;
4746
cursor: pointer;
4847
display: block;
4948
font-size: 0.875rem;
@@ -55,13 +54,13 @@ hx-menuitem {
5554
&:hover {
5655
background-color: transparent;
5756
border-color: transparent;
58-
color: @cyan-500;
57+
color: $cyan-500;
5958
}
6059

6160
&:active {
6261
background-color: transparent;
6362
border-color: transparent;
64-
color: @cyan-700;
63+
color: $cyan-700;
6564
}
6665

6766
&:focus {
@@ -71,7 +70,7 @@ hx-menuitem {
7170
&[disabled] {
7271
background-color: transparent;
7372
border-color: transparent;
74-
color: @gray-400;
73+
color: $gray-400;
7574
}
7675

7776
&.hxBtn--link { // DEPRECATED: Remove in v1.0.0
@@ -84,7 +83,7 @@ hx-menuitem-group {
8483
display: block;
8584

8685
header {
87-
color: @gray-600;
86+
color: $gray-600;
8887
font-size: 0.875rem;
8988
font-weight: 500;
9089
text-transform: uppercase;

0 commit comments

Comments
 (0)