excalidraw/packages/excalidraw/components/LibraryUnit.scss
Aakansha Doshi a8064ba3ee
build: Welcome ESM and Bye Bye UMD (#7441)
* build: Welcome ESM and Bye Bye UMD

* remove package

* create unbundled esm build

* update script for example

* fix typo

* dummy commit

* update autorelease script to build esm

* revert dummy commit

* move react, react-dom and testing library to dev dependencies

* remove entry.js, publicPath and yarn install:deps script

* fix

* upgrade esbuild to fix glob import error for locales

* remove webpack chunk names as thats not needed anymore

* marking the code sideeffects free

* make the library tree-shakeable and move fonts to fonts directory

* allow side effects for css, scss files

* remove tree-shaking

* comment code for tree shaking

* move to vite for example

* bye bye webpack

* ignore ts

* separate build and output dir

* use esbuild for creating bundle for example

* update output dir

* lint

* create browser dev build with source maps and prod with minification

* add dev and prod builds for bundler

* lint

* update script

* remove await

* load prod build

* create minified build in dist

* prod and dev builds using export field

* remove import.meta

* dummy

* define import.meta prod and dev

* fix

* export types

* add types field

* typo

* lint

* Update scripts/buildPackage.js

* move types inside export

* newline
2024-01-01 20:18:44 +05:30

185 lines
3.4 KiB
SCSS

@import "../css/variables.module.scss";
.excalidraw {
.library-unit {
align-items: center;
border: 1px solid transparent;
display: flex;
justify-content: center;
position: relative;
width: 55px;
height: 55px;
box-sizing: border-box;
border-radius: var(--border-radius-lg);
svg {
// to prevent clicks on links and such
pointer-events: none;
}
&--hover {
border-color: var(--color-primary);
}
&--selected {
border-color: var(--color-primary);
border-width: 1px;
}
&--skeleton {
opacity: 0.5;
background: linear-gradient(
-45deg,
var(--color-gray-10),
var(--color-gray-20),
var(--color-gray-10)
);
background-size: 200% 200%;
animation: library-unit__skeleton-opacity-animation 0.2s linear;
}
}
&.theme--dark .library-unit--skeleton {
background-image: linear-gradient(
-45deg,
var(--color-gray-100),
var(--color-gray-80),
var(--color-gray-100)
);
}
.library-unit__dragger {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
width: 100%;
}
.library-unit__dragger > svg {
filter: var(--theme-filter);
flex-grow: 1;
max-height: 100%;
max-width: 100%;
}
.library-unit__checkbox-container,
.library-unit__checkbox-container:hover,
.library-unit__checkbox-container:active {
align-items: center;
background: none;
border: none;
color: var(--icon-fill-color);
display: flex;
justify-content: center;
margin: 0;
padding: 0.5rem;
position: absolute;
left: 2rem;
bottom: 2rem;
cursor: pointer;
input {
cursor: pointer;
}
}
.library-unit__checkbox {
position: absolute;
top: 0.125rem;
right: 0.125rem;
margin: 0;
.Checkbox-box {
margin: 0;
width: 1rem;
height: 1rem;
border-radius: 4px;
background-color: var(--color-primary-light);
border: 1px solid var(--color-primary);
box-shadow: none !important;
padding: 2px;
}
&.Checkbox:hover {
.Checkbox-box {
background-color: var(--color-primary-light);
}
}
&.is-checked {
.Checkbox-box {
background-color: var(--color-primary) !important;
svg {
color: var(--color-primary-light);
}
}
}
}
.library-unit__removeFromLibrary > svg {
height: 16px;
width: 16px;
}
.library-unit__adder {
transform: scale(1);
animation: library-unit__adder-animation 1s ease-in infinite;
position: absolute;
width: 1.5rem;
height: 1.5rem;
background-color: var(--color-primary);
border-radius: var(--border-radius-md);
display: flex;
justify-content: center;
align-items: center;
pointer-events: none;
svg {
color: var(--color-primary-light);
width: 1rem;
height: 1rem;
}
}
.library-unit:active .library-unit__adder {
animation: none;
transform: scale(0.8);
}
.library-unit__active {
cursor: pointer;
}
@keyframes library-unit__adder-animation {
0% {
transform: scale(0.85);
}
50% {
transform: scale(1);
}
100% {
transform: scale(0.85);
}
}
@keyframes library-unit__skeleton-opacity-animation {
0% {
opacity: 0;
}
75% {
opacity: 0;
}
100% {
opacity: 0.5;
}
}
}