Skip to content

Commit

Permalink
refactor: avoid top margin for first menu item (#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
lex111 authored Jul 9, 2021
1 parent 8d6bcfe commit b5de1a6
Show file tree
Hide file tree
Showing 9 changed files with 84 additions and 62 deletions.
28 changes: 16 additions & 12 deletions packages/core/dist/css/default-dark/default-dark-rtl.css
Original file line number Diff line number Diff line change
Expand Up @@ -2344,9 +2344,9 @@ hr:after {
margin-right: var(--ifm-menu-link-padding-horizontal);
}

.menu__list-item {
margin-top: 0.25rem;
}
.menu__list-item:not(:first-child) {
margin-top: 0.25rem;
}

.menu__list-item--collapsed .menu__list {
height: 0;
Expand Down Expand Up @@ -2381,17 +2381,21 @@ hr:after {
transition-timing-function: var(--ifm-transition-timing-default);
}

.menu__link--sublist:after {
background: var(--ifm-menu-link-sublist-icon) 50% / 2rem 2rem;
content: ' ';
display: inline-block;
filter: var(--ifm-menu-link-sublist-icon-filter);
height: 1.25rem;
min-width: 1.25rem;
transform: rotate(-180deg);
transition: transform var(--ifm-transition-fast) linear;
.menu__link--sublist {
margin-bottom: 0.25rem;
}

.menu__link--sublist:after {
background: var(--ifm-menu-link-sublist-icon) 50% / 2rem 2rem;
content: ' ';
display: inline-block;
filter: var(--ifm-menu-link-sublist-icon-filter);
height: 1.25rem;
min-width: 1.25rem;
transform: rotate(-180deg);
transition: transform var(--ifm-transition-fast) linear;
}

.menu__link--active {
color: var(--ifm-menu-color-active);
}
Expand Down

Large diffs are not rendered by default.

28 changes: 16 additions & 12 deletions packages/core/dist/css/default-dark/default-dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -2344,9 +2344,9 @@ hr:after {
margin-left: var(--ifm-menu-link-padding-horizontal);
}

.menu__list-item {
margin-top: 0.25rem;
}
.menu__list-item:not(:first-child) {
margin-top: 0.25rem;
}

.menu__list-item--collapsed .menu__list {
height: 0;
Expand Down Expand Up @@ -2381,17 +2381,21 @@ hr:after {
transition-timing-function: var(--ifm-transition-timing-default);
}

.menu__link--sublist:after {
background: var(--ifm-menu-link-sublist-icon) 50% / 2rem 2rem;
content: ' ';
display: inline-block;
filter: var(--ifm-menu-link-sublist-icon-filter);
height: 1.25rem;
min-width: 1.25rem;
transform: rotate(180deg);
transition: transform var(--ifm-transition-fast) linear;
.menu__link--sublist {
margin-bottom: 0.25rem;
}

.menu__link--sublist:after {
background: var(--ifm-menu-link-sublist-icon) 50% / 2rem 2rem;
content: ' ';
display: inline-block;
filter: var(--ifm-menu-link-sublist-icon-filter);
height: 1.25rem;
min-width: 1.25rem;
transform: rotate(180deg);
transition: transform var(--ifm-transition-fast) linear;
}

.menu__link--active {
color: var(--ifm-menu-color-active);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/dist/css/default-dark/default-dark.min.css

Large diffs are not rendered by default.

28 changes: 16 additions & 12 deletions packages/core/dist/css/default/default-rtl.css
Original file line number Diff line number Diff line change
Expand Up @@ -2328,9 +2328,9 @@ hr:after {
margin-right: var(--ifm-menu-link-padding-horizontal);
}

.menu__list-item {
margin-top: 0.25rem;
}
.menu__list-item:not(:first-child) {
margin-top: 0.25rem;
}

.menu__list-item--collapsed .menu__list {
height: 0;
Expand Down Expand Up @@ -2365,17 +2365,21 @@ hr:after {
transition-timing-function: var(--ifm-transition-timing-default);
}

.menu__link--sublist:after {
background: var(--ifm-menu-link-sublist-icon) 50% / 2rem 2rem;
content: ' ';
display: inline-block;
filter: var(--ifm-menu-link-sublist-icon-filter);
height: 1.25rem;
min-width: 1.25rem;
transform: rotate(-180deg);
transition: transform var(--ifm-transition-fast) linear;
.menu__link--sublist {
margin-bottom: 0.25rem;
}

.menu__link--sublist:after {
background: var(--ifm-menu-link-sublist-icon) 50% / 2rem 2rem;
content: ' ';
display: inline-block;
filter: var(--ifm-menu-link-sublist-icon-filter);
height: 1.25rem;
min-width: 1.25rem;
transform: rotate(-180deg);
transition: transform var(--ifm-transition-fast) linear;
}

.menu__link--active {
color: var(--ifm-menu-color-active);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/dist/css/default/default-rtl.min.css

Large diffs are not rendered by default.

28 changes: 16 additions & 12 deletions packages/core/dist/css/default/default.css
Original file line number Diff line number Diff line change
Expand Up @@ -2328,9 +2328,9 @@ hr:after {
margin-left: var(--ifm-menu-link-padding-horizontal);
}

.menu__list-item {
margin-top: 0.25rem;
}
.menu__list-item:not(:first-child) {
margin-top: 0.25rem;
}

.menu__list-item--collapsed .menu__list {
height: 0;
Expand Down Expand Up @@ -2365,17 +2365,21 @@ hr:after {
transition-timing-function: var(--ifm-transition-timing-default);
}

.menu__link--sublist:after {
background: var(--ifm-menu-link-sublist-icon) 50% / 2rem 2rem;
content: ' ';
display: inline-block;
filter: var(--ifm-menu-link-sublist-icon-filter);
height: 1.25rem;
min-width: 1.25rem;
transform: rotate(180deg);
transition: transform var(--ifm-transition-fast) linear;
.menu__link--sublist {
margin-bottom: 0.25rem;
}

.menu__link--sublist:after {
background: var(--ifm-menu-link-sublist-icon) 50% / 2rem 2rem;
content: ' ';
display: inline-block;
filter: var(--ifm-menu-link-sublist-icon-filter);
height: 1.25rem;
min-width: 1.25rem;
transform: rotate(180deg);
transition: transform var(--ifm-transition-fast) linear;
}

.menu__link--active {
color: var(--ifm-menu-color-active);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/core/dist/css/default/default.min.css

Large diffs are not rendered by default.

26 changes: 16 additions & 10 deletions packages/core/styles/components/menu.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
}

&__list-item {
margin-top: 0.25rem;
&:not(:first-child) {
margin-top: 0.25rem;
}

&--collapsed {
^^&__list {
Expand Down Expand Up @@ -66,15 +68,19 @@
text-decoration: none;
}

&--sublist:after {
background: var(--ifm-menu-link-sublist-icon) 50% / 2rem 2rem;
content: ' ';
display: inline-block;
filter: var(--ifm-menu-link-sublist-icon-filter);
height: 1.25rem;
min-width: 1.25rem;
transform: rotate(180deg);
@mixin transition transform, var(--ifm-transition-fast), linear;
&--sublist {
margin-bottom: 0.25rem;

&:after {
background: var(--ifm-menu-link-sublist-icon) 50% / 2rem 2rem;
content: ' ';
display: inline-block;
filter: var(--ifm-menu-link-sublist-icon-filter);
height: 1.25rem;
min-width: 1.25rem;
transform: rotate(180deg);
@mixin transition transform, var(--ifm-transition-fast), linear;
}
}

&:hover {
Expand Down

0 comments on commit b5de1a6

Please sign in to comment.