penpot/frontend/resources/styles/common/framework.scss
2024-06-27 15:35:57 +02:00

377 lines
6.2 KiB
SCSS

// 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
// Buttons
%btn {
appearance: none;
align-items: center;
border: none;
border-radius: $br3;
cursor: pointer;
display: flex;
font-family: "worksans", sans-serif;
font-size: $fs12;
height: 30px;
justify-content: center;
min-width: 25px;
padding: 0 1rem;
transition: all 0.4s;
text-decoration: none !important;
svg {
height: 16px;
width: 16px;
}
&.btn-large {
font-size: $fs14;
height: 40px;
svg {
height: 20px;
width: 20px;
}
}
&.btn-small {
height: 25px;
}
}
.btn-primary {
@extend %btn;
background: $color-primary;
color: $color-black;
&:hover,
&:focus {
background: $color-black;
color: $color-primary;
}
}
input[type="button"][disabled],
.btn-disabled {
background-color: $color-gray-10;
color: $color-gray-40;
pointer-events: none;
}
// Doted list
.doted-list {
li {
align-items: center;
display: flex;
padding: $size-2 0;
&::before {
background-color: $color-complete;
border-radius: 50%;
content: "";
flex-shrink: 0;
height: 10px;
margin-right: 6px;
width: 10px;
}
&.not-included {
text-decoration: line-through;
}
}
}
// Input elements
.input-element {
display: flex;
flex-shrink: 0;
position: relative;
width: 75px;
&::after,
.after {
color: $color-gray-20;
font-size: $fs12;
height: 20px;
position: absolute;
right: $size-2;
text-align: right;
top: 26%;
width: 18px;
pointer-events: none;
max-width: 4rem;
overflow: hidden;
text-overflow: ellipsis;
}
.after {
width: auto;
right: 6px;
}
&.mini {
width: 43px;
}
&.auto {
width: auto;
}
// Input amounts
&.pixels {
& input {
padding-right: 20px;
}
&::after {
content: "px";
}
}
&.percentail {
&::after {
content: "%";
}
}
&.milliseconds {
&::after {
content: "ms";
}
}
&.degrees {
&::after {
content: "dg";
}
}
&.height {
&::after {
content: "H";
}
}
&.width {
&::after {
content: "W";
}
}
&.Xaxis {
&::after {
content: "X";
}
}
&.Yaxis {
&::after {
content: "Y";
}
}
&.maxW {
&::after {
content: attr(alt);
}
}
&.minW {
&::after {
content: attr(alt);
}
}
&.maxH {
&::after {
content: attr(alt);
}
}
&.minH {
&::after {
content: attr(alt);
}
}
&.large {
min-width: 7rem;
}
}
input,
select {
box-sizing: border-box;
font-family: "worksans", sans-serif;
font-size: $fs14;
margin-bottom: $size-4;
-webkit-appearance: none;
-moz-appearance: none;
}
input[type="radio"],
input[type="checkbox"] {
box-sizing: border-box;
cursor: pointer;
line-height: $lh-normal;
margin-top: 1px 0 0;
}
.form-errors {
color: $color-danger;
}
// Input slidebar
input[type="range"] {
background-color: transparent;
-webkit-appearance: none;
margin: 10px 0 10px 3px;
max-width: 70px;
width: 100%;
}
input[type="range"]:focus {
outline: none;
}
input[type="range"]::-webkit-slider-runnable-track {
width: 100%;
height: 6px;
cursor: pointer;
animate: 0.2s;
box-shadow:
0px 0px 0px #000000,
0px 0px 0px #0d0d0d;
background: $color-gray-60;
border-radius: $br25;
border: 0px solid #000101;
}
input[type="range"]::-webkit-slider-thumb {
box-shadow:
0px 0px 0px #000000,
0px 0px 0px #0d0d0d;
border: 0px solid #000000;
height: 18px;
width: 6px;
border-radius: $br7;
background: $color-gray-20;
cursor: pointer;
-webkit-appearance: none;
margin-top: -6px;
}
input[type="range"]:focus::-webkit-slider-runnable-track {
background: $color-gray-60;
}
input[type="range"]::-moz-range-track {
width: 100%;
height: 8px;
cursor: pointer;
animate: 0.2s;
box-shadow:
0px 0px 0px #000000,
0px 0px 0px #0d0d0d;
background: $color-gray-60;
border-radius: $br25;
border: 0px solid #000101;
}
input[type="range"]::-moz-range-thumb {
box-shadow:
0px 0px 0px #000000,
0px 0px 0px #0d0d0d;
border: 0px solid #000000;
height: 24px;
width: 8px;
border-radius: $br7;
background: $color-gray-20;
cursor: pointer;
}
input[type="range"]::-ms-track {
width: 100%;
height: 8px;
cursor: pointer;
animate: 0.2s;
background: transparent;
border-color: transparent;
border-width: 39px 0;
color: transparent;
}
input[type="range"]::-ms-fill-lower {
background: $color-gray-60;
border: 0px solid #000101;
border-radius: $br50;
box-shadow:
0px 0px 0px #000000,
0px 0px 0px #0d0d0d;
}
input[type="range"]::-ms-fill-upper {
background: $color-gray-60;
border: 0px solid #000101;
border-radius: $br50;
box-shadow:
0px 0px 0px #000000,
0px 0px 0px #0d0d0d;
}
input[type="range"]::-ms-thumb {
box-shadow:
0px 0px 0px #000000,
0px 0px 0px #0d0d0d;
border: 0px solid #000000;
height: 24px;
width: 8px;
border-radius: $br7;
background: $color-gray-20;
cursor: pointer;
}
input[type="range"]:focus::-ms-fill-lower {
background: $color-gray-60;
}
input[type="range"]:focus::-ms-fill-upper {
background: $color-gray-60;
}
// Scroll bar (chrome)
::-webkit-scrollbar {
background-color: transparent;
cursor: pointer;
height: 8px;
width: 8px;
}
::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
background-color: transparent;
}
::-webkit-scrollbar-thumb {
background-color: $color-gray-20;
&:hover {
background-color: darken($color-gray-20, 14%);
outline: 2px solid $color-primary;
}
}
.message-inline {
background-color: $color-info;
color: $color-info-darker;
margin-bottom: 1.2rem;
padding: 0.8rem;
text-align: center;
p {
margin: 0;
}
.code {
font-family: monospace;
}
}
[draggable] {
-moz-user-select: none;
-khtml-user-select: none;
-webkit-user-select: none;
user-select: none;
/* Required to make elements draggable in old WebKit */
-khtml-user-drag: element;
-webkit-user-drag: element;
}