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
072c113e
Commit
072c113e
authored
4 years ago
by
druid
Browse files
Options
Downloads
Patches
Plain Diff
keyboard onEnter open the card; style changes
parent
bb5ba029
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-general-list-item/hy-general-list-item.scss
+1
-1
1 addition, 1 deletion
...components/hy-general-list-item/hy-general-list-item.scss
src/components/hy-general-list-item/hy-general-list-item.tsx
+18
-3
18 additions, 3 deletions
src/components/hy-general-list-item/hy-general-list-item.tsx
with
19 additions
and
4 deletions
src/components/hy-general-list-item/hy-general-list-item.scss
+
1
−
1
View file @
072c113e
...
...
@@ -77,7 +77,7 @@
}
&
--description
{
@include
font-size
(
14px
,
18
px
);
@include
font-size
(
14px
,
20
px
);
color
:
var
(
--
grayscale-dark
);
letter-spacing
:
-0
.08px
;
}
...
...
This diff is collapsed.
Click to expand it.
src/components/hy-general-list-item/hy-general-list-item.tsx
+
18
−
3
View file @
072c113e
import
{
Component
,
h
,
Prop
}
from
'
@stencil/core
'
;
import
{
Component
,
Element
,
h
,
Listen
,
Prop
}
from
'
@stencil/core
'
;
let
keys
=
{
enter
:
'
Enter
'
,
};
@
Component
({
tag
:
'
hy-general-list-item
'
,
...
...
@@ -14,6 +18,17 @@ export class HyGeneralListItem {
@
Prop
()
imageUrl
:
string
=
null
;
@
Prop
()
imageAlt
:
string
=
''
;
@
Element
()
el
:
HTMLElement
;
@
Listen
(
'
keydown
'
)
handleKeyDown
(
event
)
{
const
key
=
(
event
as
KeyboardEvent
).
code
;
if
(
key
==
keys
.
enter
)
{
let
card
=
this
.
el
;
window
.
open
(
card
.
dataset
.
location
,
'
_blank
'
);
}
}
render
()
{
const
classAttributes
=
[
'
hy-general-list-item
'
].
join
(
'
'
);
...
...
@@ -23,8 +38,8 @@ export class HyGeneralListItem {
//const target = '_blank';
//const ariaLabel = 'Link points outside the current website.';
const
aspectRatioWidth
=
6
;
const
aspectRatioHeight
=
4
;
const
aspectRatioWidth
=
1
6
;
const
aspectRatioHeight
=
10
;
const
aspect
=
(
aspectRatioHeight
/
aspectRatioWidth
)
*
100
;
const
aspectRatio
=
{
'
--aspectRatio
'
:
`
${
aspect
}
%`
as
'
aspectRatio
'
,
...
...
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