Skip to content

Commit cf57440

Browse files
committed
Add prefix to css keyframes to avoid possible naming conflict with client code
1 parent 8e406a0 commit cf57440

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@szhsin/react-menu",
3-
"version": "0.10.2",
3+
"version": "0.10.3",
44
"description": "React menu components",
55
"author": "Zheng Song",
66
"license": "MIT",

src/components/styles/_animations.scss

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
@use 'sass:list';
22

3+
$menu: "rc-menu-";
34
$duration: 0.15s;
45
$directions: (
56
"left": "X" 1,
@@ -10,11 +11,11 @@ $directions: (
1011

1112
@mixin slide($dir) {
1213
&--open#{&}--dir-#{$dir} {
13-
animation: slide-out-#{$dir} $duration ease-out;
14+
animation: #{$menu}slide-out-#{$dir} $duration ease-out;
1415
}
1516

1617
&--closing#{&}--dir-#{$dir} {
17-
animation: slide-in-#{$dir} $duration ease-in;
18+
animation: #{$menu}slide-in-#{$dir} $duration ease-in;
1819
}
1920
}
2021

@@ -32,7 +33,7 @@ $directions: (
3233
$axis: list.nth($value, 1);
3334
$sign: list.nth($value, 2);
3435

35-
@keyframes slide-out-#{$dir} {
36+
@keyframes #{$menu}slide-out-#{$dir} {
3637
from {
3738
@include slide-start($axis, $sign);
3839
}
@@ -41,7 +42,7 @@ $directions: (
4142
}
4243
}
4344

44-
@keyframes slide-in-#{$dir} {
45+
@keyframes #{$menu}slide-in-#{$dir} {
4546
from {
4647
@include slide-end;
4748
}

0 commit comments

Comments
 (0)