refactor: unify NOTE_WIDTH constant with --note-width CSS variable
Read note width from the CSS custom property at runtime (cached on first call) instead of duplicating the value in a JS constant.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { onMounted, watch, type Ref } from "vue"
|
||||
|
||||
import { NOTE_WIDTH } from "@/constants/note-width"
|
||||
import { getNoteWidth } from "@/constants/note-width"
|
||||
import { useOverlay } from "@/hooks/useOverlay.hook"
|
||||
|
||||
export const useResizeContainer = (
|
||||
@@ -22,7 +22,7 @@ export const useResizeContainer = (
|
||||
container.style.height = `${(stackedNotes.value.length + 1) * 100}vh`
|
||||
} else {
|
||||
container.style.width = `${
|
||||
NOTE_WIDTH * (stackedNotes.value.length + 1)
|
||||
getNoteWidth() * (stackedNotes.value.length + 1)
|
||||
}px`
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user