Fix padding in the library loading buttons (#2331)
* Fix padding in the library loading buttons * Update src/components/Stack.tsx Co-authored-by: Dominic Lee <34794189+dominictwlee@users.noreply.github.com> * extend CSSProperties TS definition Co-authored-by: Dominic Lee <34794189+dominictwlee@users.noreply.github.com> Co-authored-by: dwelle <luzar.david@gmail.com>
This commit is contained in:
parent
eca2bdabcc
commit
facde7ace0
@ -260,11 +260,7 @@ export const ColorPicker = ({
|
|||||||
<button
|
<button
|
||||||
className="color-picker-label-swatch"
|
className="color-picker-label-swatch"
|
||||||
aria-label={label}
|
aria-label={label}
|
||||||
style={
|
style={color ? { "--swatch-color": color } : undefined}
|
||||||
color
|
|
||||||
? ({ "--swatch-color": color } as React.CSSProperties)
|
|
||||||
: undefined
|
|
||||||
}
|
|
||||||
onClick={() => setActive(!isActive)}
|
onClick={() => setActive(!isActive)}
|
||||||
ref={pickerButton}
|
ref={pickerButton}
|
||||||
/>
|
/>
|
||||||
|
@ -14,7 +14,7 @@ export const Island = React.forwardRef<HTMLDivElement, IslandProps>(
|
|||||||
({ children, padding, className, style }, ref) => (
|
({ children, padding, className, style }, ref) => (
|
||||||
<div
|
<div
|
||||||
className={clsx("Island", className)}
|
className={clsx("Island", className)}
|
||||||
style={{ "--padding": padding, ...style } as React.CSSProperties}
|
style={{ "--padding": padding, ...style }}
|
||||||
ref={ref}
|
ref={ref}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
|
@ -114,7 +114,12 @@ const LibraryMenuItems = ({
|
|||||||
let addedPendingElements = false;
|
let addedPendingElements = false;
|
||||||
|
|
||||||
rows.push(
|
rows.push(
|
||||||
<Stack.Row align="center" gap={1} key={"actions"}>
|
<Stack.Row
|
||||||
|
align="center"
|
||||||
|
gap={1}
|
||||||
|
key={"actions"}
|
||||||
|
style={{ padding: "2px 0" }}
|
||||||
|
>
|
||||||
<ToolButton
|
<ToolButton
|
||||||
key="import"
|
key="import"
|
||||||
type="button"
|
type="button"
|
||||||
|
@ -36,13 +36,11 @@ export const Modal = (props: {
|
|||||||
<div className="Modal__background" onClick={props.onCloseRequest}></div>
|
<div className="Modal__background" onClick={props.onCloseRequest}></div>
|
||||||
<div
|
<div
|
||||||
className="Modal__content"
|
className="Modal__content"
|
||||||
style={
|
style={{
|
||||||
{
|
"--max-width": `${props.maxWidth}px`,
|
||||||
"--max-width": `${props.maxWidth}px`,
|
maxHeight: "100%",
|
||||||
maxHeight: "100%",
|
overflowY: "scroll",
|
||||||
overflowY: "scroll",
|
}}
|
||||||
} as any
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
{props.children}
|
{props.children}
|
||||||
</div>
|
</div>
|
||||||
|
@ -9,6 +9,7 @@ type StackProps = {
|
|||||||
align?: "start" | "center" | "end" | "baseline";
|
align?: "start" | "center" | "end" | "baseline";
|
||||||
justifyContent?: "center" | "space-around" | "space-between";
|
justifyContent?: "center" | "space-around" | "space-between";
|
||||||
className?: string | boolean;
|
className?: string | boolean;
|
||||||
|
style?: React.CSSProperties;
|
||||||
};
|
};
|
||||||
|
|
||||||
const RowStack = ({
|
const RowStack = ({
|
||||||
@ -17,17 +18,17 @@ const RowStack = ({
|
|||||||
align,
|
align,
|
||||||
justifyContent,
|
justifyContent,
|
||||||
className,
|
className,
|
||||||
|
style,
|
||||||
}: StackProps) => {
|
}: StackProps) => {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={clsx("Stack Stack_horizontal", className)}
|
className={clsx("Stack Stack_horizontal", className)}
|
||||||
style={
|
style={{
|
||||||
{
|
"--gap": gap,
|
||||||
"--gap": gap,
|
alignItems: align,
|
||||||
alignItems: align,
|
justifyContent,
|
||||||
justifyContent,
|
...style,
|
||||||
} as React.CSSProperties
|
}}
|
||||||
}
|
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
@ -44,13 +45,11 @@ const ColStack = ({
|
|||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={clsx("Stack Stack_vertical", className)}
|
className={clsx("Stack Stack_vertical", className)}
|
||||||
style={
|
style={{
|
||||||
{
|
"--gap": gap,
|
||||||
"--gap": gap,
|
justifyItems: align,
|
||||||
justifyItems: align,
|
justifyContent,
|
||||||
justifyContent,
|
}}
|
||||||
} as React.CSSProperties
|
|
||||||
}
|
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
|
10
src/css.d.ts
vendored
Normal file
10
src/css.d.ts
vendored
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import "csstype";
|
||||||
|
|
||||||
|
declare module "csstype" {
|
||||||
|
interface Properties {
|
||||||
|
"--max-width"?: number | string;
|
||||||
|
"--swatch-color"?: string;
|
||||||
|
"--gap"?: number | string;
|
||||||
|
"--padding"?: number | string;
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user