feat(figma): added dark mode support

This commit is contained in:
Karsa
2024-03-17 12:01:04 +01:00
parent a8c6add82b
commit 78054456a4
9 changed files with 33 additions and 28 deletions
@@ -1,18 +1,20 @@
.icon-button {
padding: 8px;
color: var(--color-black);
color: var(--figma-color-text);
background: transparent;
border: 0;
border-radius: 2px;
border-radius: 4px;
appearance: none;
outline: 0;
cursor: pointer;
aspect-ratio: 1;
&:hover {
background: rgba(0, 0, 0, 0.06);
background: var(--figma-color-bg-hover);
}
&:focus,
&:active {
box-shadow: inset 0 0 0 2px var(--color-blue);
box-shadow: inset 0 0 0 2px var(--figma-color-border-selected);
}
}
@@ -4,20 +4,20 @@
flex-shrink: 0;
height: 40px;
line-height: 40px;
border-bottom: 1px solid var(--color-border, #e5e5e5);
border-bottom: 1px solid var(--figma-color-border);
justify-content: flex-start;
}
.menu-item {
font-weight: 500;
font-size: 11px;
color: var(--color-text-tertiary, #b3b3b3);
color: var(--figma-color-text-tertiary);
padding: 0 8px;
text-transform: capitalize;
cursor: pointer;
&.active {
color: var(--color-text, #333333);
color: var(--figma-color-text);
}
&:first-child {
@@ -6,8 +6,12 @@
.icon {
position: absolute;
left: 16px;
fill: var(--figma-color-text);
opacity: .5;
}
input {
background: var(--figma-color-bg);
color: var(--figma-color-text);
width: 100%;
height: 40px;
padding: 0 16px 0 36px;
@@ -5,14 +5,9 @@
}
.skeleton {
--block: rgba(0, 0, 0, 0.06);
--loader: hsl(0 0% 89%);
background:
linear-gradient(-75deg, transparent 40%, var(--loader), transparent 60%) 0 0 / 200% 100%,
var(--block);
border-radius: calc(var(--padding) * 0.5);
linear-gradient(-75deg, transparent 40%, var(--figma-color-bg-tertiary), transparent 60%) 0 0 / 200% 100%,
var(--figma-color-bg-secondary);
animation: load 2s infinite linear;
background-attachment: fixed;
width: 40px;
@@ -1 +1 @@
<svg fill="none" height="32" viewBox="0 0 32 32" width="32" xmlns="http://www.w3.org/2000/svg"><path clip-rule="evenodd" d="m18.8744 19.5815c-1.0453.8849-2.3975 1.4185-3.8744 1.4185-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6c0 1.4769-.5336 2.8291-1.4185 3.8744l4.2721 4.272-.7072.7072zm1.1256-4.5815c0 2.7614-2.2386 5-5 5s-5-2.2386-5-5 2.2386-5 5-5 5 2.2386 5 5z" fill="#000" fill-rule="evenodd"/></svg>
<svg fill="none" height="32" viewBox="0 0 32 32" width="32" xmlns="http://www.w3.org/2000/svg"><path clip-rule="evenodd" d="m18.8744 19.5815c-1.0453.8849-2.3975 1.4185-3.8744 1.4185-3.3137 0-6-2.6863-6-6s2.6863-6 6-6 6 2.6863 6 6c0 1.4769-.5336 2.8291-1.4185 3.8744l4.2721 4.272-.7072.7072zm1.1256-4.5815c0 2.7614-2.2386 5-5 5s-5-2.2386-5-5 2.2386-5 5-5 5 2.2386 5 5z" fill="currentColor" fill-rule="evenodd"/></svg>

Before

Width:  |  Height:  |  Size: 408 B

After

Width:  |  Height:  |  Size: 417 B

+1 -1
View File
@@ -1 +1 @@
<svg fill="none" height="32" viewBox="0 0 32 32" width="32" xmlns="http://www.w3.org/2000/svg"><path clip-rule="evenodd" d="m18.3972 18.6046c-.7793.625-1.7687.9988-2.8455.9988-2.5138 0-4.5517-2.0378-4.5517-4.5517 0-2.5138 2.0379-4.5517 4.5517-4.5517 2.5139 0 4.5517 2.0379 4.5517 4.5517 0 1.0769-.3739 2.0664-.999 2.8458l3.2491 3.2492-.7071.7071zm.7062-3.5529c0 1.9616-1.5901 3.5517-3.5517 3.5517-1.9615 0-3.5517-1.5901-3.5517-3.5517 0-1.9615 1.5902-3.5517 3.5517-3.5517 1.9616 0 3.5517 1.5902 3.5517 3.5517z" fill="#000" fill-rule="evenodd"/></svg>
<svg fill="none" height="32" viewBox="0 0 32 32" width="32" xmlns="http://www.w3.org/2000/svg"><path clip-rule="evenodd" d="m18.3972 18.6046c-.7793.625-1.7687.9988-2.8455.9988-2.5138 0-4.5517-2.0378-4.5517-4.5517 0-2.5138 2.0379-4.5517 4.5517-4.5517 2.5139 0 4.5517 2.0379 4.5517 4.5517 0 1.0769-.3739 2.0664-.999 2.8458l3.2491 3.2492-.7071.7071zm.7062-3.5529c0 1.9616-1.5901 3.5517-3.5517 3.5517-1.9615 0-3.5517-1.5901-3.5517-3.5517 0-1.9615 1.5902-3.5517 3.5517-3.5517 1.9616 0 3.5517 1.5902 3.5517 3.5517z" fill="currentColor" fill-rule="evenodd"/></svg>

Before

Width:  |  Height:  |  Size: 549 B

After

Width:  |  Height:  |  Size: 558 B

@@ -18,11 +18,6 @@
url('https://rsms.me/inter/font-files/Inter-Medium.woff?v=3.9') format('woff');
}
:root {
--color-blue: #18a0fb;
--color-black: #333;
}
body {
font-family: Inter, sans-serif;
font-size: 11px;
@@ -32,10 +27,14 @@ body {
.search-input {
position: sticky;
top: 0;
border-bottom: 1px solid #e5e5e5;
border-bottom: 1px solid var(--figma-color-border);
backface-visibility: hidden;
}
.search-input {
border-bottom: 1px solid var(--figma-color-border);
}
main {
padding-bottom: 8px;
}
@@ -44,13 +43,17 @@ main {
display: grid;
grid-template-columns: repeat(6, 1fr);
grid-gap: 8px;
padding: 4px;
}
footer {
margin-top: 8px;
position: sticky;
bottom: 0;
padding: 8px;
font-size: 12px;
color: rgba(0, 0, 0, 0.5);
color: var(--figma-color-text-tertiary);
background: var(--figma-color-bg);
border-top: 1px solid var(--figma-color-border);
.footer-link {
color: inherit;
@@ -74,15 +77,16 @@ footer {
}
.lucide-logo {
color: var(--figma-color-text);
width: 160px;
}
.version {
margin-top: 8px;
padding: 8px;
font-weight: bold;
font-weight: normal;
font-size: 18px;
color: rgba(0, 0, 0, 0.5);
color: var(--figma-color-text-secondary);
}
.link-list {
@@ -92,7 +96,7 @@ footer {
}
.info-link {
color: var(--color-blue);
color: var(--figma-color-text-brand);
display: block;
padding: 2px 0;
text-decoration: none;
+1 -1
View File
@@ -144,6 +144,6 @@ figma.on('run', (event) => {
cachedIcons,
});
} else {
figma.showUI(__uiFiles__.interface, { width: 300, height: 400 });
figma.showUI(__uiFiles__.interface, { width: 300, height: 400, themeColors: true });
}
});