mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Merge pull request #12665 from grafana/9863-animated-delete-button
built a component for delete button in tables
This commit is contained in:
@@ -93,6 +93,7 @@
|
||||
@import 'components/form_select_box';
|
||||
@import 'components/user-picker';
|
||||
@import 'components/description-picker';
|
||||
@import 'components/delete_button';
|
||||
|
||||
// PAGES
|
||||
@import 'pages/login';
|
||||
|
||||
50
public/sass/components/_delete_button.scss
Normal file
50
public/sass/components/_delete_button.scss
Normal file
@@ -0,0 +1,50 @@
|
||||
// sets a fixed width so that the rest of the table
|
||||
// isn't affected by the animation
|
||||
.delete-button-container {
|
||||
width: 24px;
|
||||
direction: rtl;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
//this container is used to make sure confirm-delete isn't
|
||||
//shown outside of table
|
||||
.confirm-delete-container {
|
||||
overflow: hidden;
|
||||
width: 145px;
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.delete-button {
|
||||
position: absolute;
|
||||
|
||||
&.show {
|
||||
opacity: 1;
|
||||
transition: opacity 0.1s ease;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
&.hide {
|
||||
opacity: 0;
|
||||
transition: opacity 0.1s ease;
|
||||
z-index: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.confirm-delete {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
|
||||
&.show {
|
||||
opacity: 1;
|
||||
transition: opacity 0.08s ease-out, transform 0.1s ease-out;
|
||||
transform: translateX(0);
|
||||
}
|
||||
|
||||
&.hide {
|
||||
opacity: 0;
|
||||
transition: opacity 0.12s ease-in, transform 0.14s ease-in;
|
||||
transform: translateX(100px);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user