Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Sharkey
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Dima Krasner
Sharkey
Commits
bb5d2bda
Commit
bb5d2bda
authored
2 years ago
by
syuilo
Browse files
Options
Downloads
Patches
Plain Diff
refactor(client): use css modules
parent
d075471b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
packages/frontend/src/components/MkButton.vue
+44
-39
44 additions, 39 deletions
packages/frontend/src/components/MkButton.vue
with
44 additions
and
39 deletions
packages/frontend/src/components/MkButton.vue
+
44
−
39
View file @
bb5d2bda
<
template
>
<button
v-if=
"!link"
ref=
"el"
class=
"
bghgjjyj
_button"
:class=
"
{ inline, primary, gradate, danger, rounded, full, small, large,
asLike }"
ref=
"el"
class=
"_button"
:class=
"
[$style.root,
{ [$style.inline]: inline, [$style.primary]: primary, [$style.gradate]: gradate, [$style.danger]: danger, [$style.rounded]: rounded, [$style.full]: full, [$style.small]: small, [$style.large]: large, [$style.asLike]:
asLike }
]
"
:type="type"
@click="emit('click', $event)"
@mousedown="onMousedown"
>
<div
ref=
"ripples"
class=
"ripples"
></div>
<div
class=
"content"
>
<div
ref=
"ripples"
:
class=
"
$style.
ripples"
></div>
<div
:
class=
"
$style.
content"
>
<slot></slot>
</div>
</button>
<MkA
v-else
class=
"
bghgjjyj
_button"
:class=
"
{ inline, primary, gradate, danger, rounded, full, small
}"
v-else
class=
"_button"
:class=
"
[$style.root,
{ [$style.inline]: inline, [$style.primary]: primary, [$style.gradate]: gradate, [$style.danger]: danger, [$style.rounded]: rounded, [$style.full]: full, [$style.small]: small, [$style.large]: large, [$style.asLike]: asLike
}
]
"
:to="to"
@mousedown="onMousedown"
>
<div
ref=
"ripples"
class=
"ripples"
></div>
<div
class=
"content"
>
<div
ref=
"ripples"
:
class=
"
$style.
ripples"
></div>
<div
:
class=
"
$style.
content"
>
<slot></slot>
</div>
</MkA>
</
template
>
<
script
lang=
"ts"
setup
>
import
{
nextTick
,
onMounted
}
from
'
vue
'
;
import
{
nextTick
,
onMounted
,
useCssModule
}
from
'
vue
'
;
const
$style
=
useCssModule
();
const
props
=
defineProps
<
{
type
?:
'
button
'
|
'
submit
'
|
'
reset
'
;
...
...
@@ -78,6 +80,7 @@ function onMousedown(evt: MouseEvent): void {
const
rect
=
target
.
getBoundingClientRect
();
const
ripple
=
document
.
createElement
(
'
div
'
);
ripple
.
classList
.
add
(
$style
.
ripple
);
ripple
.
style
.
top
=
(
evt
.
clientY
-
rect
.
top
-
1
).
toString
()
+
'
px
'
;
ripple
.
style
.
left
=
(
evt
.
clientX
-
rect
.
left
-
1
).
toString
()
+
'
px
'
;
...
...
@@ -101,8 +104,8 @@ function onMousedown(evt: MouseEvent): void {
}
</
script
>
<
style
lang=
"scss"
scoped
>
.
bghgjjyj
{
<
style
lang=
"scss"
module
>
.
root
{
position
:
relative
;
z-index
:
1
;
// 他コンポーネントのbox-shadowに隠されないようにするため
display
:
block
;
...
...
@@ -173,7 +176,7 @@ function onMousedown(evt: MouseEvent): void {
}
>
.ripples
{
::v-deep
(
div
)
{
>
.ripple
{
background
:
rgba
(
255
,
60
,
106
,
0
.15
);
}
}
...
...
@@ -237,35 +240,37 @@ function onMousedown(evt: MouseEvent): void {
min-width
:
100px
;
}
>
.ripples
{
position
:
absolute
;
z-index
:
0
;
top
:
0
;
left
:
0
;
width
:
100%
;
height
:
100%
;
border-radius
:
6px
;
overflow
:
clip
;
::v-deep
(
div
)
{
position
:
absolute
;
width
:
2px
;
height
:
2px
;
border-radius
:
100%
;
background
:
rgba
(
0
,
0
,
0
,
0
.1
);
opacity
:
1
;
transform
:
scale
(
1
);
transition
:
all
0
.5s
cubic-bezier
(
0
,.
5
,
0
,
1
);
}
}
&
.primary
>
.ripples
::v-deep
(
div
)
{
&
.primary
>
.ripples
>
.ripple
{
background
:
rgba
(
0
,
0
,
0
,
0
.15
);
}
}
>
.content
{
position
:
relative
;
z-index
:
1
;
}
.ripples
{
position
:
absolute
;
z-index
:
0
;
top
:
0
;
left
:
0
;
width
:
100%
;
height
:
100%
;
border-radius
:
6px
;
overflow
:
clip
;
pointer-events
:
none
;
}
.ripple
{
position
:
absolute
;
width
:
2px
;
height
:
2px
;
border-radius
:
100%
;
background
:
rgba
(
0
,
0
,
0
,
0
.1
);
opacity
:
1
;
transform
:
scale
(
1
);
transition
:
all
0
.5s
cubic-bezier
(
0
,.
5
,
0
,
1
);
}
.content
{
position
:
relative
;
z-index
:
1
;
pointer-events
:
none
;
}
</
style
>
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