Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 50 additions & 6 deletions src/v2/scss/components/_dropdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ $dropdown-box-shadow: 0 0 1rem rgba($black, .175);
$dropdown-color: $body-color;
$dropdown-divider-bg: $gray-lighter;
$dropdown-divider-margin-y: $nav-divider-margin-y;
// FIXME: font-size-content?
$dropdown-font-size: $font-size-base;

$dropdown-font-size: $font-size-content-base;
$dropdown-link-color: $black;
$dropdown-link-hover-color: $black;
$dropdown-link-hover-bg: $gray-lighter;
Expand All @@ -20,11 +18,11 @@ $dropdown-link-active-color: $component-active-color;
$dropdown-link-active-bg: $component-active-bg;
$dropdown-link-disabled-color: $gray-disabled;

$dropdown-item-padding-y: spacer("1x");
$dropdown-item-padding-x: spacer("3x");
$dropdown-item-padding-y: spacer("2x");
$dropdown-item-padding-x: spacer("2x");

$dropdown-header-color: $gray-disabled;
$dropdown-border-radius: 4px;
$dropdown-border-radius: 0;
Comment on lines +21 to +25
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Значения по умолчанию. Меню пользователя .dropdown-user-menu модификатор.


$caret-width: 0;
$caret-vertical-align: $caret-width * .85 !default;
Expand All @@ -33,9 +31,55 @@ $caret-spacing: $caret-width * .85 !default;
// Imports
@import "bootstrap/scss/dropdown";

.dropdown.theme-dark {
color: $white;

.dropdown-menu {
background-color: lighten($gray-darker, 5);
box-shadow: none;
padding-bottom: 0;
}

.dropdown-item {
color: $white;
&:hover {
background-color: $gray-dark;
}
}

.svg-icon {
width: 1em;
height: 1em;
margin-left: 4px;
fill: $white;
}

._arrow-right {
&::after {
border-bottom: 6px solid lighten($gray-darker, 5);
}
}

.dropdown-divider {
border-top-color: $gray-dark;
}
}

.nav-item.dropdown:hover {
.nav-link {
opacity: 1;
background-color: lighten($gray-darker, 5);
}

> .dropdown-menu {
display: block;
}
}
Comment on lines +68 to +77
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Выпадающее подменю, как думаешь норм такая реализация?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Пока не смотрел, но выглядит на скрине как 2010й год)))


.dropdown-menu {
border: none;
box-shadow: $dropdown-box-shadow;
margin: -$nav-link-margin 0 0 $nav-link-margin;
}

._arrow-right {
Expand Down
8 changes: 6 additions & 2 deletions src/v2/scss/layouts/_menu.scss
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ body {
}

.dropdown-user-menu {
margin-left: auto;
margin-left: auto; //for mobile view
margin-right: -$navbar-toggler-padding-x;

._user {
Expand All @@ -320,9 +320,13 @@ body {
}

.dropdown-menu {
font-size: $font-size-content-base;
right: $navbar-toggler-padding-x;
left: auto;
border-radius: 4px;
}

.dropdown-item {
padding: spacer("1x") spacer("3x");
Comment on lines +325 to +329
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Кастомные свойства для .dropdown-user-menu

}

.btn {
Expand Down
13 changes: 9 additions & 4 deletions templates/v2/components/menu/_macros.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,14 @@
<li class="nav-item">
<a class="nav-link _active" href="/v2/pages/about/">О центре</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/v2/pages/programs/">Программы</a>
</li>
<li class="nav-item dropdown theme-dark">
<a class="nav-link">Программы {{ macros.svg_icon('arrow-bottom') }}</a>
<div class="dropdown-menu">
<a class="dropdown-item" href="#">Computer science</a>
<a class="dropdown-item" href="#">Data science</a>
<a class="dropdown-item" href="#">Software engeneering</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Курсы</a>
</li>
Expand Down Expand Up @@ -176,4 +181,4 @@
{% endif %}
</div>
{% if show_notification %}<div class="top-banner-spacer"></div>{% endif %}
{%- endmacro %}
{%- endmacro %}