Skip to content

AI-native design editor. Open-source Figma alternative.

Fix scrollbar: use utility class instead of global selector

Danila Poyarkovc3e081062071
diff --git a/src/app.css b/src/app.css
index 8deed8c91..154de2d2d 100644
--- a/src/app.css
+++ b/src/app.css
@@ -9,6 +9,25 @@
}
}
+@utility scrollbar-thin {
+ scrollbar-width: thin;
+ scrollbar-color: var(--color-border) transparent;
+ &::-webkit-scrollbar {
+ width: 6px;
+ height: 6px;
+ }
+ &::-webkit-scrollbar-track {
+ background: transparent;
+ }
+ &::-webkit-scrollbar-thumb {
+ background: var(--color-border);
+ border-radius: 3px;
+ }
+ &::-webkit-scrollbar-thumb:hover {
+ background: var(--color-muted);
+ }
+}
+
@theme {
--color-panel: #2a2a2a;
--color-canvas: #1e1e1e;
@@ -41,29 +60,6 @@ body {
-webkit-user-select: none;
}
-* {
- scrollbar-width: thin;
- scrollbar-color: var(--color-border) transparent;
-}
-
-::-webkit-scrollbar {
- width: 6px;
- height: 6px;
-}
-
-::-webkit-scrollbar-track {
- background: transparent;
-}
-
-::-webkit-scrollbar-thumb {
- background: var(--color-border);
- border-radius: 3px;
-}
-
-::-webkit-scrollbar-thumb:hover {
- background: var(--color-muted);
-}
-
input[type='number'] {
appearance: textfield;
-moz-appearance: textfield;
diff --git a/src/components/DesignPanel.vue b/src/components/DesignPanel.vue
index 40da75a18..9e82fa995 100644
--- a/src/components/DesignPanel.vue
+++ b/src/components/DesignPanel.vue
@@ -28,7 +28,7 @@ const isComponentType = computed(() => {
<template>
<!-- Multi-select summary -->
- <div v-if="multiCount > 1" class="flex-1 overflow-x-hidden overflow-y-auto pb-4">
+ <div v-if="multiCount > 1" class="flex-1 overflow-x-hidden overflow-y-auto scrollbar-thin pb-4">
<div class="flex items-center gap-1.5 border-b border-border px-3 py-2">
<span class="text-[11px] text-muted">Mixed</span>
<span class="text-xs font-semibold">{{ multiCount }} layers</span>
@@ -41,7 +41,7 @@ const isComponentType = computed(() => {
</div>
<!-- Single selection -->
- <div v-else-if="node" class="flex-1 overflow-x-hidden overflow-y-auto pb-4">
+ <div v-else-if="node" class="flex-1 overflow-x-hidden overflow-y-auto scrollbar-thin pb-4">
<!-- Node header -->
<div class="flex items-center gap-1.5 border-b border-border px-3 py-2">
<span class="text-[11px]" :class="isComponentType ? 'text-[#9747ff]' : 'text-muted'">{{
@@ -80,7 +80,7 @@ const isComponentType = computed(() => {
<ExportSection />
</div>
- <div v-else class="flex-1 overflow-x-hidden overflow-y-auto pb-4">
+ <div v-else class="flex-1 overflow-x-hidden overflow-y-auto scrollbar-thin pb-4">
<PageSection />
<VariablesSection @open-dialog="variablesOpen = true" />
</div>
diff --git a/src/components/LayersPanel.vue b/src/components/LayersPanel.vue
index b86f25078..a24b9c0dd 100644
--- a/src/components/LayersPanel.vue
+++ b/src/components/LayersPanel.vue
@@ -284,7 +284,7 @@ function updateDropTarget(ev: PointerEvent) {
</header>
<ContextMenuRoot :modal="false">
<ContextMenuTrigger as-child @contextmenu="onLayerRightClick">
- <div ref="listRef" class="relative flex-1 overflow-y-auto px-1">
+ <div ref="listRef" class="relative flex-1 overflow-y-auto scrollbar-thin px-1">
<TreeRoot
:key="treeKey"
v-slot="{ flattenItems }"
diff --git a/src/components/PagesPanel.vue b/src/components/PagesPanel.vue
index c8e48ff83..534a45c60 100644
--- a/src/components/PagesPanel.vue
+++ b/src/components/PagesPanel.vue
@@ -55,7 +55,7 @@ function onKeydown(e: KeyboardEvent, pageId: string) {
+
</button>
</div>
- <div class="overflow-x-hidden overflow-y-auto px-1 pb-1">
+ <div class="overflow-x-hidden overflow-y-auto scrollbar-thin px-1 pb-1">
<div v-for="pg in pages" :key="pg.id">
<input
v-if="editingPageId === pg.id"