Skip to content

Commit

Permalink
align copy buttons to flex-start + always visible (skrub-data#1086)
Browse files Browse the repository at this point in the history
* align copy buttons to flex-start + always visible

* move copybuttons on the left
  • Loading branch information
jeromedockes authored Sep 24, 2024
1 parent 4184f97 commit 91d1f05
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 17 deletions.
2 changes: 1 addition & 1 deletion skrub/_reporting/_data/templates/buttons.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% macro copybutton(target) %}
<button
class="copybutton"
class="copybutton copybutton-left"
type="button"
onclick="copyButtonClick(event)"
data-target-id="{{ target }}">
Expand Down
39 changes: 23 additions & 16 deletions skrub/_reporting/_data/templates/copybutton.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,32 @@
}

.copybutton {
margin-left: -2rem;
margin: 1px;
min-width: 2rem;
display: none;
min-height: calc(1.8rem - 4px);
display: inline-block;
padding: var(--micro);
padding-left: var(--tiny);
padding-right: var(--tiny);
border: none;
background: var(--lightg);
position: relative;
align-self: flex-start;
}

.copybutton[data-show-checkmark]{
display: inline-block;
.copybutton-left {
order: -1;
}

.copybutton {
background: #e0e0e0;
}

.copybutton:hover {
background: #eee;
}

.copybutton:active {
background: #cccccc;
}

.copybutton:not([data-show-checkmark]) > :not(:first-child) {
Expand All @@ -53,22 +66,16 @@
padding: 5px;
border-radius: var(--radius, 5px);
position: absolute;
right: calc(100% + 5px);
top: 3px;
top: 1px;
margin: 0;
right: calc(100% + 5px);
}

.box:hover .copybutton {
display: inline-block;
background: var(--lightg);
}

.box:hover .copybutton:hover {
display: inline-block;
background: var(--mediumg);
.copybutton-left .copied-message {
left: calc(100% + 5px);
right: auto;
}


[data-shows-placeholder] {
color: #777777;
}
Expand Down

0 comments on commit 91d1f05

Please sign in to comment.