Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
design-system-lib
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
julkiset-sivut
design-system-lib
Commits
4a01c17e
Commit
4a01c17e
authored
4 years ago
by
katja
Browse files
Options
Downloads
Patches
Plain Diff
university main menu dropdown
parent
bf2e9f79
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/components/hy-menu-main-group/hy-menu-main-group.scss
+26
-9
26 additions, 9 deletions
src/components/hy-menu-main-group/hy-menu-main-group.scss
src/components/hy-menu-main-group/hy-menu-main-group.tsx
+28
-7
28 additions, 7 deletions
src/components/hy-menu-main-group/hy-menu-main-group.tsx
with
54 additions
and
16 deletions
src/components/hy-menu-main-group/hy-menu-main-group.scss
+
26
−
9
View file @
4a01c17e
...
...
@@ -6,7 +6,6 @@
align-items
:
center
;
display
:
flex
;
flex-flow
:
row
;
position
:
relative
;
margin-left
:
28px
;
@include
breakpoint
(
$narrow
)
{
margin-left
:
32px
;
...
...
@@ -17,7 +16,8 @@
}
.menu--main-group__toggle
{
@include
font-size
(
14px
,
24px
);
@include
font-size
(
14px
,
16px
);
@include
font-weight
(
$semibold
);
align-items
:
center
;
background
:
var
(
--
grayscale-black
);
border
:
0
none
;
...
...
@@ -25,8 +25,7 @@
display
:
flex
;
flex-flow
:
row
;
font-family
:
var
(
--
main-font-family
);
font-weight
:
600
;
letter-spacing
:
-0
.4px
;
letter-spacing
:
-0
.44px
;
margin
:
0
-4px
;
padding
:
0
;
...
...
@@ -34,6 +33,14 @@
}
&
:hover
{
}
svg
{
}
span
{
@include
breakpoint
(
$wide
)
{
margin-left
:
17px
;
}
}
}
.menu--main-group__dropdown
{
...
...
@@ -46,22 +53,32 @@
box-shadow
:
0
10px
10px
rgba
(
0
,
0
,
0
,
0
.2
);
color
:
var
(
--
grayscale-white
);
display
:
flex
;
flex-flow
:
column
;
justify-items
:
center
;
left
:
-15px
;
left
:
0
;
margin
:
0
;
padding
:
15
px
;
padding
:
6px
0
20
px
;
position
:
absolute
;
top
:
0
;
visibility
:
visible
;
width
:
max-content
;
width
:
100%
;
z-index
:
100
;
.list
{
display
:
flex
;
flex-flow
:
column
;
justify-items
:
center
;
position
:
relative
;
}
.menu-main-link
{
@include
font-size
(
16px
,
20px
);
align-items
:
center
;
display
:
flex
;
flex-direction
:
row
;
margin-bottom
:
20px
;
text-decoration
:
none
;
}
.menu--main-group__label
{
color
:
var
(
--
grayscale-white
);
margin-left
:
12px
;
}
}
}
This diff is collapsed.
Click to expand it.
src/components/hy-menu-main-group/hy-menu-main-group.tsx
+
28
−
7
View file @
4a01c17e
...
...
@@ -27,6 +27,22 @@ export class HyMenuMainGroup {
@
Listen
(
'
click
'
)
handleComponentClick
(
event
)
{
this
.
isMenuOpen
=
!
this
.
isMenuOpen
;
if
(
this
.
isMenuOpen
)
{
let
hyTopHeader
=
this
.
el
.
closest
(
'
.hy-site-header__content-top
'
)
as
HTMLElement
;
let
mainMenuToggle
=
event
.
target
.
shadowRoot
.
querySelector
(
'
.menu--main-group__toggle
'
)
as
HTMLElement
;
let
mainMenuDropdown
=
event
.
target
.
shadowRoot
.
querySelector
(
'
.menu--main-group__dropdown
'
)
as
HTMLElement
;
let
mainMenuList
=
event
.
target
.
shadowRoot
.
querySelector
(
'
.list
'
)
as
HTMLElement
;
if
(
hyTopHeader
&&
mainMenuDropdown
&&
mainMenuList
&&
mainMenuToggle
)
{
let
rectHeader
=
hyTopHeader
.
getBoundingClientRect
();
let
rectMenuToggle
=
mainMenuToggle
.
getBoundingClientRect
();
mainMenuDropdown
.
style
.
top
=
`
${
rectHeader
.
height
}
px`
;
mainMenuList
.
style
.
left
=
`
${
rectMenuToggle
.
left
}
px`
;
}
}
event
.
stopPropagation
();
}
...
...
@@ -62,13 +78,18 @@ export class HyMenuMainGroup {
'
is-open
'
:
this
.
isMenuOpen
,
}
}
>
{
this
.
_dataMainMenu
.
map
((
item
)
=>
{
return
(
<
a
href
=
{
item
.
url
}
class
=
{
{
'
menu-main-link
'
:
true
}
}
>
<
span
class
=
{
'
menu--main-group__label
'
}
>
{
item
.
label
}
</
span
>
</
a
>
);
})
}
<
div
class
=
"list"
>
{
this
.
_dataMainMenu
.
map
((
item
)
=>
{
return
(
<
a
href
=
{
item
.
url
}
class
=
{
{
'
menu-main-link
'
:
true
}
}
>
<
span
class
=
"heading-icon"
>
<
hy
-
icon
icon
=
{
'
hy-icon-caret-right
'
}
size
=
{
10
}
fill
=
{
white
}
/>
</
span
>
<
span
class
=
{
'
menu--main-group__label
'
}
>
{
item
.
label
}
</
span
>
</
a
>
);
})
}
</
div
>
</
div
>
</
Host
>
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment