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-assets.scss

315 lines
6 KiB
SCSS
Raw Normal View History

2020-07-23 17:11:36 +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) 2015-2016 Andrey Antukh <niwi@niwi.nz>
// Copyright (c) 2015-2016 Juan de la Cruz <delacruzgarciajuan@gmail.com>
.assets-bar {
display: flex;
flex-direction: column;
overflow: hidden;
height: 100%;
2020-07-23 17:11:36 +02:00
.assets-bar-title {
color: $color-gray-10;
font-size: $fs14;
margin: $small $small 0 $small;
2020-08-05 13:30:26 +02:00
display: flex;
align-items: center;
cursor: pointer;
& .libraries-button {
margin-left: auto;
display: flex;
align-items: center;
svg {
fill: $color-gray-30;
height: 20px;
width: 20px;
padding-right: $x-small;
}
}
& .libraries-button:hover {
color: $color-primary;
& svg {
fill: $color-primary;
}
}
2020-07-23 17:11:36 +02:00
}
2020-07-30 14:52:58 +02:00
.search-block {
2020-07-23 17:11:36 +02:00
border: 1px solid $color-gray-30;
margin: $small $small 0 $small;
padding: $x-small;
2020-07-30 14:52:58 +02:00
display: flex;
align-items: center;
2020-07-23 17:11:36 +02:00
&:hover {
border-color: $color-gray-20;
}
2020-08-05 13:30:26 +02:00
&:focus-within {
border-color: $color-primary;
}
2020-07-30 14:52:58 +02:00
& .search-input {
background-color: $color-gray-50;
border: none;
color: $color-gray-10;
font-size: $fs12;
margin: 0;
padding: 0;
flex-grow: 1;
&:focus {
color: lighten($color-gray-10, 8%);
}
}
& .search-icon {
display: flex;
align-items: center;
svg {
fill: $color-gray-30;
2020-08-05 13:30:26 +02:00
height: 16px;
width: 16px;
2020-07-30 14:52:58 +02:00
}
&.close {
transform: rotate(45deg);
cursor: pointer;
}
}
2020-07-23 17:11:36 +02:00
}
.input-select {
background-color: $color-gray-50;
color: $color-gray-10;
border: 1px solid transparent;
border-bottom-color: $color-gray-40;
padding: $x-small $x-small 0 $x-small;
margin: $small $small $medium $small;
&:focus {
color: lighten($color-gray-10, 8%);
}
option {
color: $color-gray-60;
background: $color-white;
font-size: $fs11;
}
}
.collapse-library {
margin-right: $small;
cursor: pointer;
&.open svg {
transform: rotate(90deg);
}
}
.asset-group {
background-color: $color-gray-60;
padding: $small;
font-size: $fs11;
color: $color-gray-20;
/* TODO: see if this is useful, or is better to leave only
one scroll bar in the whole sidebar
(also see .group-list) */
// max-height: 30rem;
// overflow-y: scroll;
2020-07-23 17:11:36 +02:00
.group-title {
display: flex;
cursor: pointer;
2020-07-23 17:11:36 +02:00
& .num-assets {
2020-07-23 17:11:36 +02:00
color: $color-gray-30;
}
& svg {
height: 8px;
width: 8px;
fill: $color-gray-30;
margin-right: 4px;
transform: rotate(90deg);
}
&.closed svg {
transform: rotate(0deg);
transition: transform 0.3s;
}
2020-07-23 17:11:36 +02:00
}
.group-button {
margin-left: auto;
cursor: pointer;
& svg {
width: 0.7rem;
height: 0.7rem;
fill: #F0F0F0;
}
&:hover svg {
fill: $color-primary;
}
2020-07-23 17:11:36 +02:00
}
.group-grid {
margin-top: $small;
display: grid;
grid-template-columns: 1fr 1fr 1fr;
grid-auto-rows: 7vh;
column-gap: 0.5rem;
row-gap: 0.5rem;
2020-09-01 15:09:57 +02:00
&.big {
grid-template-columns: 1fr 1fr;
grid-auto-rows: 10vh;
.grid-cell {
padding: $x-small;
2020-09-01 15:09:57 +02:00
& svg {
height: 10vh;
}
}
}
2020-07-23 17:11:36 +02:00
}
.grid-cell {
background-color: $color-white;
border-radius: 4px;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
position: relative;
2020-07-30 14:52:58 +02:00
cursor: pointer;
2020-07-23 17:11:36 +02:00
& img {
max-height: 100%;
max-width: 100%;
height: auto;
width: auto;
pointer-events: none;
2020-07-23 17:11:36 +02:00
}
}
.cell-name {
background-color: $color-gray-60;
font-size: $fs9;
display: none;
position: absolute;
left: 0;
bottom: 0;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.grid-cell:hover {
border: 1px solid $color-primary;
& .cell-name {
display: block;
}
}
/* TODO: see if this is useful, or is better to leave only
one scroll bar in the whole sidebar
(also see .asset-group) */
// .group-list {
// max-height: 30rem;
// overflow-y: scroll;
// }
.group-list-item {
display: flex;
align-items: center;
margin-top: $x-small;
font-size: $fs11;
color: $color-white;
2020-07-30 14:52:58 +02:00
cursor: pointer;
& span {
margin-left: $x-small;
color: $color-gray-30;
text-transform: uppercase;
}
}
2020-07-23 17:11:36 +02:00
.context-menu {
position: fixed;
2020-07-23 17:11:36 +02:00
top: 10px;
left: 10px;
}
}
}
2020-08-07 14:55:22 +02:00
.modal-create-color {
position: relative;
background-color: $color-white;
padding: 4rem;
display: flex;
flex-direction: column;
align-items: center;
& .sketch-picker, .chrome-picker {
box-shadow: none !important;
border: 1px solid $color-gray-10 !important;
border-radius: 0 !important;
& input {
background-color: $color-white;
}
}
& .close {
position: absolute;
right: 1rem;
transform: rotate(45deg);
top: 1rem;
svg {
fill: $color-black;
height: 20px;
width: 20px;
&:hover {
fill: $color-danger;
}
}
}
& .btn-primary {
width: 10rem;
padding: 0.5rem;
margin-top: 1rem;
}
}
.modal-create-color-title {
color: $color-black;
font-size: 24px;
font-weight: normal;
}
.libraries-wrapper {
overflow: auto;
display: flex;
flex-direction: column;
flex: 1;
}