Commit 7df65a18 authored by Maroun, Kristin's avatar Maroun, Kristin
Browse files

Merge branch 'fix-styling-for-input-fields-and-dropdowns' into 'main'

Fix styling for input fields and dropdowns

See merge request ndip/public-packages/nova-trame!56
parents 3ef2e212 1f2ca1d8
Loading
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@ class GridLayout(html.Div):
        width: Optional[Union[int, str]] = None,
        halign: Optional[str] = None,
        valign: Optional[str] = None,
        gap: Optional[Union[int, str]] = "0em",
        **kwargs: Any,
    ) -> None:
        """Constructor for GridLayout.
@@ -64,7 +65,7 @@ class GridLayout(html.Div):
            classes = " ".join(classes)
        classes += " d-grid"

        style = self.get_root_styles(columns, height, width, halign, valign) | kwargs.pop("style", {})
        style = self.get_root_styles(columns, height, width, halign, valign, gap) | kwargs.pop("style", {})

        super().__init__(classes=classes, style=style, **kwargs)

@@ -75,9 +76,11 @@ class GridLayout(html.Div):
        width: Optional[Union[int, str]],
        halign: Optional[str],
        valign: Optional[str],
        gap: Optional[Union[int, str]],
    ) -> dict[str, str]:
        height = f"{height}px" if isinstance(height, int) else height
        width = f"{width}px" if isinstance(width, int) else width
        gap = f"{gap}px" if isinstance(gap, int) else gap

        styles = {
            "grid-template-columns": f"repeat({columns}, 1fr)",
@@ -91,6 +94,8 @@ class GridLayout(html.Div):
            styles["justify-items"] = halign
        if valign:
            styles["align-items"] = valign
        if gap:
            styles["gap"] = gap

        return styles

+11 −1
Original line number Diff line number Diff line
@@ -14,6 +14,8 @@ class HBoxLayout(html.Div):
        width: Optional[Union[int, str]] = None,
        halign: Optional[str] = None,
        valign: Optional[str] = None,
        gap: Optional[Union[int, str]] = "0em",
        vspace: Optional[Union[int, str]] = "0em",
        **kwargs: Any,
    ) -> None:
        """Constructor for HBoxLayout.
@@ -51,7 +53,7 @@ class HBoxLayout(html.Div):
            classes = " ".join(classes)
        classes += " d-flex flex-row"

        style = self.get_root_styles(height, width, halign, valign) | kwargs.pop("style", {})
        style = self.get_root_styles(height, width, halign, valign, gap, vspace) | kwargs.pop("style", {})

        super().__init__(classes=classes, style=style, **kwargs)

@@ -61,9 +63,13 @@ class HBoxLayout(html.Div):
        width: Optional[Union[int, str]],
        halign: Optional[str],
        valign: Optional[str],
        gap: Optional[Union[int, str]],
        vspace: Optional[Union[int, str]],
    ) -> dict:
        height = f"{height}px" if isinstance(height, int) else height
        width = f"{width}px" if isinstance(width, int) else width
        gap = f"{gap}px" if isinstance(gap, int) else gap
        vspace = f"{vspace}px" if isinstance(vspace, int) else vspace

        styles = {}

@@ -75,5 +81,9 @@ class HBoxLayout(html.Div):
            styles["justify-content"] = halign
        if valign:
            styles["align-items"] = valign
        if gap:
            styles["gap"] = gap
        if vspace:
            styles["margin-bottom"] = vspace

        return styles
+11 −1
Original line number Diff line number Diff line
@@ -14,6 +14,8 @@ class VBoxLayout(html.Div):
        width: Optional[Union[int, str]] = None,
        halign: Optional[str] = None,
        valign: Optional[str] = None,
        gap: Optional[Union[int, str]] = "0em",
        vspace: Optional[Union[int, str]] = "0em",
        **kwargs: Any,
    ) -> None:
        """Constructor for VBoxLayout.
@@ -51,7 +53,7 @@ class VBoxLayout(html.Div):
            classes = " ".join(classes)
        classes += " d-flex flex-column"

        style = self.get_root_styles(height, width, halign, valign) | kwargs.pop("style", {})
        style = self.get_root_styles(height, width, halign, valign, gap, vspace) | kwargs.pop("style", {})

        super().__init__(classes=classes, style=style, **kwargs)

@@ -61,9 +63,13 @@ class VBoxLayout(html.Div):
        width: Optional[Union[int, str]],
        halign: Optional[str],
        valign: Optional[str],
        gap: Optional[Union[int, str]],
        vspace: Optional[Union[int, str]],
    ) -> dict:
        height = f"{height}px" if isinstance(height, int) else height
        width = f"{width}px" if isinstance(width, int) else width
        gap = f"{gap}px" if isinstance(gap, int) else gap
        vspace = f"{vspace}px" if isinstance(vspace, int) else vspace

        styles = {}

@@ -75,5 +81,9 @@ class VBoxLayout(html.Div):
            styles["align-items"] = halign
        if valign:
            styles["justify-content"] = valign
        if gap:
            styles["gap"] = gap
        if vspace:
            styles["margin-bottom"] = vspace

        return styles
+22 −4
Original line number Diff line number Diff line
@@ -12,6 +12,20 @@ html {
    box-shadow: none !important;
}

.v-tab.v-btn {
    height: 30px !important;
    min-width: fit-content !important;
    padding: 10px !important;
}

.v-container {
    padding: 0px !important;
}

.v-checkbox .v-selection-control {
    min-height: 0px !important;
}

.mpl-message, .ui-dialog-titlebar {
    display: none !important;
}
@@ -20,6 +34,11 @@ html {
    resize: none !important;
}

&.v-window {
    overflow-x: visible !important;
    overflow-y: visible !important;
}

@media only screen and (max-width: 959px) {
    .d-grid {
        grid-template-columns: repeat(1, 1fr) !important;
@@ -64,7 +83,6 @@ html {
        text-transform: none;
    }


    .v-label {
        font-size: 0.75rem;
    }
+8 −4
Original line number Diff line number Diff line
@@ -56,7 +56,8 @@
        },
        "VFileInput": {
            "color": "primary",
            "prependIcon": false
            "prependIcon": false,
            "variant": "outlined"
        },
        "VLabel": {
            "style": {
@@ -91,7 +92,8 @@
            "color": "primary"
        },
        "VSelect": {
            "color": "primary"
            "color": "primary",
            "variant": "outlined"
        },
        "VSlider": {
            "color": "primary"
@@ -106,10 +108,12 @@
            "color": "primary"
        },
        "VTextarea": {
            "color": "primary"
            "color": "primary",
            "variant": "outlined"
        },
        "VTextField": {
            "color": "primary"
            "color": "primary",
            "variant": "outlined"
        },
        "VWindowItem": {
            "reverseTransition": "fade-transition",