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
b9748fe0
Commit
b9748fe0
authored
4 years ago
by
druid
Browse files
Options
Downloads
Patches
Plain Diff
focus, hover styles
parent
a9ad4061
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/link-box/link-box.scss
+45
-13
45 additions, 13 deletions
src/components/link-box/link-box.scss
src/components/link-box/link-box.tsx
+32
-0
32 additions, 0 deletions
src/components/link-box/link-box.tsx
with
77 additions
and
13 deletions
src/components/link-box/link-box.scss
+
45
−
13
View file @
b9748fe0
...
...
@@ -142,9 +142,9 @@
font-family
:
var
(
--
main-font-family
);
letter-spacing
:
-0
.6px
;
margin-bottom
:
8px
;
// Margin if there is an image above the title
margin-top
:
20px
;
// Margin if there is no image above the title
margin-top
:
20px
;
// Margin if there is an image above the title
&
__image
{
margin-top
:
16px
;
}
...
...
@@ -183,9 +183,9 @@
@include
font-size
(
28px
,
36px
);
letter-spacing
:
-0
.8px
;
margin-bottom
:
12px
;
// Margin if there is an image above the title
margin-top
:
32px
;
// Margin if there is no image above the title
margin-top
:
32px
;
// Margin if there is an image above the title
&
__image
{
margin-top
:
20px
;
}
...
...
@@ -225,20 +225,12 @@
.hy-link-box__text-container
{
margin-bottom
:
60px
;
padding
:
0
12px
;
//20px btw pic and title, 24px above title if no pic
@include
breakpoint
(
$narrow
)
{
padding
:
0
16px
;
//20px btw pic and title, 24px above title if no pic
}
@include
breakpoint
(
$wide
)
{
padding
:
0
12px
;
//16px btw pic and title, 24px above title if no pic
}
@include
breakpoint
(
$extrawide
)
{
&
__large
{
//20px btw pic and title, 32px above title if no pic
}
}
//@todo check title + description styles
...
...
@@ -249,7 +241,19 @@
font-family
:
var
(
--
main-font-family
);
letter-spacing
:
-0
.5px
;
margin-bottom
:
8px
;
// Margin if there is no image above the title
margin-top
:
24px
;
// Margin if there is an image above the title
&
__image
{
margin-top
:
20px
;
}
@include
breakpoint
(
$wide
)
{
// Margin if there is an image above the title
&
__image
{
margin-top
:
16px
;
}
}
@include
breakpoint
(
$extrawide
)
{
// with sidebar
&
__common
{
...
...
@@ -261,6 +265,12 @@
@include
font-size
(
20px
,
24px
);
letter-spacing
:
-0
.6px
;
margin-bottom
:
12px
;
// Margin if there is no image above the title
margin-top
:
32px
;
// Margin if there is an image above the title
&
__image
{
margin-top
:
20px
;
}
}
}
@include
breakpoint
(
$xlarge
)
{
...
...
@@ -268,6 +278,12 @@
@include
font-size
(
20px
,
24px
);
letter-spacing
:
-0
.6px
;
margin-bottom
:
12px
;
// Margin if there is no image above the title
margin-top
:
32px
;
// Margin if there is an image above the title
&
__image
{
margin-top
:
20px
;
}
}
}
...
...
@@ -280,6 +296,16 @@
}
}
}
// General styles for title
.hy-link-box__text-container
{
&
__title
{
&
__hover
{
color
:
var
(
--
brand-main
);
text-decoration
:
underline
;
}
}
}
}
.hy-link-box-link
{
...
...
@@ -288,7 +314,7 @@
right
:
-6px
;
svg
{
background-color
:
var
(
--
brand-main
);
background-color
:
var
(
--
brand-main
-light
);
box-shadow
:
0
2px
8px
0
rgba
(
0
,
0
,
0
,
0
.05
);
fill
:
var
(
--
grayscale-white
);
height
:
32px
;
...
...
@@ -296,6 +322,12 @@
width
:
32px
;
}
&
__hover
{
svg
{
background-color
:
var
(
--
brand-main
);
}
}
@include
breakpoint
(
$extrawide
)
{
// without sidebar, Landing MAJOR variation only
&
__landing
.large
{
...
...
This diff is collapsed.
Click to expand it.
src/components/link-box/link-box.tsx
+
32
−
0
View file @
b9748fe0
...
...
@@ -49,6 +49,38 @@ export class LinkBox implements ComponentInterface {
window
.
open
(
card
.
dataset
.
location
,
card
.
dataset
.
target
);
}
@
Listen
(
'
mouseenter
'
)
handleMouseEnter
(
event
)
{
this
.
manageHoverEffect
(
event
.
currentTarget
);
}
@
Listen
(
'
mouseleave
'
)
handleMouseLeave
(
event
)
{
this
.
manageHoverEffect
(
event
.
currentTarget
,
false
);
}
@
Listen
(
'
focusin
'
)
handleOnFocusIn
(
event
)
{
this
.
manageHoverEffect
(
event
.
currentTarget
);
}
@
Listen
(
'
focusout
'
)
handleOnFocusOut
(
event
)
{
this
.
manageHoverEffect
(
event
.
currentTarget
,
false
);
}
manageHoverEffect
(
linkbox
,
hoverOn
=
true
)
{
let
title
=
linkbox
.
shadowRoot
.
querySelector
(
'
h3.hy-link-box__text-container__title
'
);
let
boxLink
=
linkbox
.
shadowRoot
.
querySelector
(
'
.hy-link-box-link
'
);
if
(
hoverOn
)
{
(
title
as
HTMLElement
).
classList
.
add
(
'
hy-link-box__text-container__title__hover
'
);
(
boxLink
as
HTMLElement
).
classList
.
add
(
'
hy-link-box-link__hover
'
);
}
else
{
(
title
as
HTMLElement
).
classList
.
remove
(
'
hy-link-box__text-container__title__hover
'
);
(
boxLink
as
HTMLElement
).
classList
.
remove
(
'
hy-link-box-link__hover
'
);
}
}
render
()
{
const
classContainerAttributes
=
[
'
hy-link-box-container
'
].
join
(
'
'
);
...
...
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