Skip to content

Commit

Permalink
Implement color picker item tooltip on hover
Browse files Browse the repository at this point in the history
Implement color picker item tooltip on hover
  • Loading branch information
pkong-ds authored May 27, 2024
2 parents b682545 + ce2b940 commit bdedcf8
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/pages/model/[model]/color/[color].astro
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@ if (deviceDetail == null) {
? "color-picker-item--selected"
: ""
}`}
/>
>
<div class="color-picker-item__tooltip">{d.color.name}</div>
</a>
</li>
))
}
Expand Down
29 changes: 29 additions & 0 deletions src/styles/upload.css
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,7 @@ main {
}

.color-picker-item {
position: relative;
width: 30px;
height: 30px;
border: 3px white solid;
Expand Down Expand Up @@ -436,6 +437,34 @@ main {
margin-left: 18px;
}

.color-picker-item .color-picker-item__tooltip {
visibility: hidden;
opacity: 0;
transition: opacity 0.3s;

background-color: white;

padding: 4px 8px;
border-radius: 4px;
border: 1px #e7e7e7 solid;

color: black;
font-size: 12px;
font-weight: 400;
line-height: 18.5px;
text-align: center;
text-wrap: nowrap;

position: absolute;
z-index: 1;
top: 45px;
left: 30px;
}
.color-picker-item:hover .color-picker-item__tooltip {
visibility: visible;
opacity: 1;
}

.generate-btn {
margin: 20px 0 0 0;
padding: 8px 50px;
Expand Down

0 comments on commit bdedcf8

Please sign in to comment.