Remove project divider in titlebar

This commit is contained in:
Nate Butler
2023-08-29 19:50:27 -04:00
parent 2af5fc5030
commit 97d187bba7
8 changed files with 35 additions and 38 deletions
+2
View File
@@ -1,4 +1,6 @@
import { interactive, Interactive } from "./interactive"
import { toggleable, Toggleable } from "./toggle"
export * from "./padding"
export * from "./margin"
export { interactive, Interactive, toggleable, Toggleable }
+41
View File
@@ -0,0 +1,41 @@
type MarginOptions = {
all?: number
left?: number
right?: number
top?: number
bottom?: number
}
export type MarginStyle = {
top: number
bottom: number
left: number
right: number
}
export const margin_style = (options: MarginOptions): MarginStyle => {
const { all, top, bottom, left, right } = options
if (all !== undefined)
return {
top: all,
bottom: all,
left: all,
right: all,
}
if (
top === undefined &&
bottom === undefined &&
left === undefined &&
right === undefined
)
throw new Error("Margin must have at least one value")
return {
top: top || 0,
bottom: bottom || 0,
left: left || 0,
right: right || 0,
}
}
+41
View File
@@ -0,0 +1,41 @@
type PaddingOptions = {
all?: number
left?: number
right?: number
top?: number
bottom?: number
}
export type PaddingStyle = {
top: number
bottom: number
left: number
right: number
}
export const padding_style = (options: PaddingOptions): PaddingStyle => {
const { all, top, bottom, left, right } = options
if (all !== undefined)
return {
top: all,
bottom: all,
left: all,
right: all,
}
if (
top === undefined &&
bottom === undefined &&
left === undefined &&
right === undefined
)
throw new Error("Padding must have at least one value")
return {
top: top || 0,
bottom: bottom || 0,
left: left || 0,
right: right || 0,
}
}