0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-03 04:49:03 -05:00
penpot/frontend/resources/styles/main/partials/sidebar-layers.scss

456 lines
7.3 KiB
SCSS
Raw Normal View History

2016-03-01 20:39:13 +02:00
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// Copyright (c) KALEIDOS INC
2016-03-01 20:39:13 +02:00
2020-03-24 14:38:13 +01:00
.element-list-body {
align-items: center;
2016-02-14 20:37:01 +01:00
display: flex;
2020-04-25 18:26:17 +02:00
height: 32px;
2021-10-05 10:16:44 +02:00
padding: $size-1 $size-2;
2020-03-24 14:38:13 +01:00
transition: none;
2016-02-14 20:37:01 +01:00
width: 100%;
2023-02-28 12:56:46 +01:00
.toggle-content {
svg {
display: flex;
height: 13px;
width: 13px;
}
}
2016-02-14 20:37:01 +01:00
.icon {
position: relative;
display: flex;
align-items: center;
justify-content: center;
margin-right: 4px;
margin-bottom: 3px;
width: 18px;
height: 18px;
svg {
fill: $color-gray-20;
height: 12px;
width: 12px;
}
& .absolute {
position: absolute;
top: 0;
left: 0;
width: 18px;
height: 18px;
svg {
width: 18px;
height: 18px;
fill: $color-gray-20;
fill-opacity: 0.5;
}
}
}
&.selected .icon .absolute svg {
fill: $color-primary;
}
&:hover .icon .absolute svg {
fill: $color-gray-60;
2020-03-24 14:38:13 +01:00
}
2020-09-01 15:09:57 +02:00
2020-03-24 14:38:13 +01:00
&.group {
&.open {
.toggle-content {
flex-shrink: 0;
2020-09-01 15:09:57 +02:00
2016-03-11 21:04:26 +01:00
svg {
transform: rotate(270deg);
}
}
2016-02-14 20:37:01 +01:00
}
}
2020-09-01 15:09:57 +02:00
2020-03-24 14:38:13 +01:00
&:hover {
background-color: $color-primary;
2020-09-01 15:09:57 +02:00
2020-03-24 14:38:13 +01:00
svg {
fill: $color-gray-60 !important;
}
2020-09-01 15:09:57 +02:00
2020-03-24 14:38:13 +01:00
.element-icon,
.element-actions {
svg {
fill: $color-gray-60;
2016-02-14 20:37:01 +01:00
}
}
2020-09-01 15:09:57 +02:00
2020-03-24 14:38:13 +01:00
.element-actions > * {
2016-02-14 20:37:01 +01:00
display: flex;
2020-03-24 14:38:13 +01:00
}
2020-09-01 15:09:57 +02:00
2020-03-24 14:38:13 +01:00
span {
color: $color-gray-60;
}
2023-01-05 16:35:12 +01:00
input {
color: $color-white !important;
}
2020-09-01 15:09:57 +02:00
2020-03-24 14:38:13 +01:00
.toggle-content {
2016-02-14 20:37:01 +01:00
svg {
2020-03-03 13:14:37 +01:00
fill: $color-gray-60;
2016-02-14 20:37:01 +01:00
}
2020-03-24 14:38:13 +01:00
}
}
2016-02-14 20:37:01 +01:00
2020-03-24 14:38:13 +01:00
&.selected {
2020-10-02 14:41:04 +02:00
background-color: $color-gray-60;
2020-09-01 15:09:57 +02:00
2020-03-24 14:38:13 +01:00
svg {
fill: $color-primary;
}
2020-09-01 15:09:57 +02:00
2020-03-24 14:38:13 +01:00
.element-icon {
svg {
fill: $color-primary;
2016-02-14 20:37:01 +01:00
}
2020-03-24 14:38:13 +01:00
}
2016-02-14 20:37:01 +01:00
2020-03-24 14:38:13 +01:00
span {
color: $color-primary;
}
2020-09-01 15:09:57 +02:00
2020-03-24 14:38:13 +01:00
&:hover {
background-color: $color-primary;
2020-09-01 15:09:57 +02:00
2020-03-24 14:38:13 +01:00
.element-icon,
.element-actions {
2016-02-14 20:37:01 +01:00
svg {
2020-03-24 14:38:13 +01:00
fill: $color-gray-60;
2016-02-14 20:37:01 +01:00
}
}
2020-03-24 14:38:13 +01:00
.element-name {
color: $color-gray-60;
2016-02-14 20:37:01 +01:00
}
2020-03-24 14:38:13 +01:00
}
}
2020-09-01 15:09:57 +02:00
2020-03-24 14:38:13 +01:00
&.drag-top {
border-top: 40px solid $color-gray-60 !important;
}
2020-09-01 15:09:57 +02:00
2020-03-24 14:38:13 +01:00
&.drag-bottom {
border-bottom: 40px solid $color-gray-60 !important;
}
2020-09-01 15:09:57 +02:00
2020-03-24 14:38:13 +01:00
&.drag-inside {
border: 2px solid $color-primary !important;
}
}
2016-02-14 20:37:01 +01:00
.element-list li.sticky {
> :first-child {
position: sticky;
top: 0px;
background-color: $color-gray-50;
z-index: 1;
&.selected {
background-color: #1f1f1f;
}
&:hover {
background-color: #31efb8;
}
}
}
2020-09-01 15:09:57 +02:00
.element-list li.component {
.element-list-body {
span.element-name {
2020-09-01 15:09:57 +02:00
color: $color-component;
}
svg {
fill: $color-component;
}
&.selected {
span.element-name {
2020-09-01 15:09:57 +02:00
color: $color-component-highlight;
}
svg {
fill: $color-component-highlight;
}
}
&:hover {
background-color: $color-component-highlight;
span.element-name {
2020-09-01 15:09:57 +02:00
color: $color-gray-60;
}
2023-01-05 16:35:12 +01:00
input.element-name {
color: $color-white !important;
}
2020-09-01 15:09:57 +02:00
svg {
fill: $color-gray-60;
}
}
}
}
.element-list li.masked > .element-children > li {
&:first-child {
position: relative;
&::before {
content: " ";
border-right: 1px solid $color-gray-40;
border-top: 1px solid $color-gray-40;
position: absolute;
width: 6px;
height: 6px;
transform: rotate(-45deg);
top: -1px;
left: -4px;
2020-10-15 10:59:23 +02:00
}
&.sticky {
margin-top: 32px;
}
}
2020-10-15 10:59:23 +02:00
&:last-child {
border-left: none;
position: relative;
&::after {
content: " ";
border-left: 1px solid $color-gray-40;
border-bottom: 1px solid $color-gray-40;
height: 1rem;
width: 0.3rem;
position: absolute;
top: 0;
left: 0;
2020-10-15 10:59:23 +02:00
}
}
}
2020-03-24 14:38:13 +01:00
.element-icon {
svg {
fill: $color-gray-30;
}
}
2016-08-31 17:22:27 +03:00
2020-03-24 14:38:13 +01:00
input.element-name {
2022-03-02 12:01:47 +01:00
max-width: 75%;
2023-01-05 16:35:12 +01:00
margin-right: 5px;
background-color: $color-gray-50;
color: $color-white;
&:focus,
&:focus-within {
outline: none;
border: 1px solid $color-primary;
}
2020-03-24 14:38:13 +01:00
}
2016-02-14 20:37:01 +01:00
2020-03-24 14:38:13 +01:00
span.element-name {
color: $color-gray-20;
display: block;
2020-04-25 18:26:17 +02:00
font-size: $fs12;
2022-03-02 12:01:47 +01:00
max-width: 75%;
2020-03-24 14:38:13 +01:00
min-width: 40px;
min-height: 16px;
2022-07-15 10:57:53 +02:00
overflow: hidden;
2020-03-24 14:38:13 +01:00
text-overflow: ellipsis;
white-space: nowrap;
2022-03-21 21:57:00 +01:00
flex: 1;
2020-03-24 14:38:13 +01:00
}
2020-09-01 15:09:57 +02:00
2020-03-24 14:38:13 +01:00
.element-actions {
display: flex;
flex-shrink: 0;
height: 14px;
margin-left: auto;
position: relative;
width: 32px;
2022-02-01 16:52:36 +01:00
&.is-parent {
right: 0;
}
2020-03-24 14:38:13 +01:00
2020-03-30 09:48:22 +02:00
svg {
height: 13px;
width: 13px;
}
2020-03-24 14:38:13 +01:00
> * {
display: none;
}
2020-09-01 15:09:57 +02:00
2020-03-24 14:38:13 +01:00
.toggle-element,
.block-element {
border: none;
background-color: transparent;
2020-03-24 14:38:13 +01:00
left: 0;
position: absolute;
top: 0;
2020-09-01 15:09:57 +02:00
2020-03-24 14:38:13 +01:00
&.selected {
display: flex;
2016-02-14 20:37:01 +01:00
svg {
fill: $color-gray-20;
}
2020-03-24 14:38:13 +01:00
}
}
}
2016-02-14 20:37:01 +01:00
2020-03-24 14:38:13 +01:00
.block-element {
left: 18px !important;
2016-02-14 20:37:01 +01:00
2020-03-24 14:38:13 +01:00
svg {
fill: $color-gray-30;
}
}
2016-02-14 20:37:01 +01:00
2020-03-24 14:38:13 +01:00
.toggle-content {
2022-02-01 16:52:36 +01:00
margin-left: 8px;
2020-03-24 14:38:13 +01:00
width: 12px;
2020-09-01 15:09:57 +02:00
2020-03-24 14:38:13 +01:00
svg {
2020-04-25 18:26:17 +02:00
fill: $color-gray-20;
2020-03-24 14:38:13 +01:00
transform: rotate(90deg);
width: 10px;
}
2020-09-01 15:09:57 +02:00
2020-03-24 14:38:13 +01:00
&.inverse {
svg {
transform: rotate(270deg);
}
2020-03-24 14:38:13 +01:00
}
2020-09-01 15:09:57 +02:00
2020-03-24 14:38:13 +01:00
&:hover {
svg {
fill: $color-gray-60;
2016-02-14 20:37:01 +01:00
}
}
2020-03-30 09:48:22 +02:00
}
.icon-layer {
> svg {
background-color: rgba(255, 255, 255, 0.6);
border-radius: $br3;
2020-03-30 09:48:22 +02:00
flex-shrink: 0;
2020-03-30 13:20:07 +02:00
fill: $color-black !important;
2020-03-30 09:48:22 +02:00
padding: 1px;
}
}
2022-03-15 20:03:13 +01:00
#layers {
.tool-window-bar,
.pages-tool-bar {
2022-03-15 20:03:13 +01:00
display: flex;
justify-content: space-between;
height: 32px;
margin-top: 8px;
&.search {
.search-box {
2023-01-05 16:35:12 +01:00
border: 1px solid $color-gray-20;
border-radius: $br4;
2022-03-15 20:03:13 +01:00
height: 32px;
width: 100%;
display: flex;
align-items: center;
2023-01-05 16:35:12 +01:00
&:active,
&:focus-within {
border: 1px solid $color-primary;
}
2022-03-15 20:03:13 +01:00
input {
border: 0;
width: 100%;
background-color: $color-gray-50;
color: $color-white;
font-size: $fs12;
2022-03-15 20:03:13 +01:00
height: 16px;
2023-01-05 16:35:12 +01:00
&:focus {
outline: none;
}
2022-03-15 20:03:13 +01:00
}
div {
2022-03-15 20:03:13 +01:00
height: 16px;
overflow: hidden;
}
.filter,
.clear {
width: 35px;
&.active {
svg {
fill: $color-primary;
}
}
}
}
}
svg {
width: 16px;
height: 16px;
margin: 0 2px 0 5px;
cursor: pointer;
}
}
}
.active-filters {
margin-top: 5px;
line-height: 26px; // Original value was 26px; 26px/11px = 236.363636364% => $lh-236 (rounded)
font-size: $fs11;
2022-03-15 20:03:13 +01:00
margin: 0 0.5rem;
span {
background-color: $color-primary;
color: $color-black;
padding: 3px 5px;
margin: 0 2px;
border: none;
border-radius: $br4;
2022-03-15 20:03:13 +01:00
cursor: pointer;
svg {
width: 7px;
height: 7px;
vertical-align: middle;
margin-left: 5px;
}
}
}
.filters-container {
position: absolute;
display: flex;
flex-direction: column;
top: 40px;
left: 8px;
background-color: $color-white;
color: $color-gray-50;
border-radius: $br4;
2023-03-15 15:48:45 +01:00
z-index: 1;
2022-03-15 20:03:13 +01:00
span {
padding: 10px 20px 10px 10px;
border-radius: $br4;
2022-03-15 20:03:13 +01:00
svg {
width: 16px;
height: 16px;
margin-right: 10px;
vertical-align: middle;
fill: $color-gray-30;
}
&:hover {
background-color: $color-primary-lighter;
}
}
}