Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Commit

Permalink
monorepo FLOW-935 f-form global css updated
Browse files Browse the repository at this point in the history
  • Loading branch information
vikas-cldcvr committed Oct 9, 2023
1 parent 3fad68b commit 162e288
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 48 deletions.
22 changes: 22 additions & 0 deletions packages/flow-core/src/components/f-form/_f-form-variables.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
$sizes: (
"medium": 16px,
"small": 12px
);
/**
$gaps map hold gap attribute related values
**/

$gaps: (
"large": (
"gap": 16px
),
"medium": (
"gap": 12px
),
"small": (
"gap": 8px
),
"x-small": (
"gap": 4px
)
);
28 changes: 28 additions & 0 deletions packages/flow-core/src/components/f-form/f-form-global.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
@use "sass:map";

@import "./../../mixins/scss/mixins";
@import "./f-form-variables";

f-form {
@include base();
display: flex;
overflow: auto;
flex: 1 0 auto;
@each $size, $value in $sizes {
&[size="#{$size}"] {
@include inherit-size($size);
}
}
&[separator] {
@each $gap, $value in $gaps {
&[gap="#{$gap}"] {
> f-form-group {
&:not(:first-child) {
border-top: 1px solid var(--color-border-default);
padding-top: map.get($value, "gap");
}
}
}
}
}
}
48 changes: 1 addition & 47 deletions packages/flow-core/src/components/f-form/f-form.scss
Original file line number Diff line number Diff line change
@@ -1,29 +1,7 @@
@use "sass:map";

@import "./../../mixins/scss/mixins";

$sizes: (
"medium": 16px,
"small": 12px
);
/**
$gaps map hold gap attribute related values
**/

$gaps: (
"large": (
"gap": 16px
),
"medium": (
"gap": 12px
),
"small": (
"gap": 8px
),
"x-small": (
"gap": 4px
)
);
@import "./f-form-variables";

:host {
form {
Expand All @@ -37,27 +15,3 @@ $gaps: (
}
}
}

f-form {
@include base();
display: flex;
overflow: auto;
flex: 1 0 auto;
@each $size, $value in $sizes {
&[size="#{$size}"] {
@include inherit-size($size);
}
}
&[separator] {
@each $gap, $value in $gaps {
&[gap="#{$gap}"] {
> f-form-group {
&:not(:first-child) {
border-top: 1px solid var(--color-border-default);
padding-top: map.get($value, "gap");
}
}
}
}
}
}
5 changes: 4 additions & 1 deletion packages/flow-core/src/components/f-form/f-form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ import { property } from "lit/decorators.js";
import { FRoot } from "../../mixins/components/f-root/f-root";
import { FText } from "../f-text/f-text";
import eleStyle from "./f-form.scss?inline";
import globalStyle from "./f-form-global.scss?inline";
import { FDiv } from "../f-div/f-div";
import { flowElement } from "./../../utils";
import { injectCss } from "@cldcvr/flow-core-config";
injectCss("f-form", globalStyle);

// import { ref, createRef } from "lit/directives/ref.js";

Expand All @@ -16,7 +19,7 @@ export class FForm extends FRoot {
/**
* css loaded from scss file
*/
static styles = [unsafeCSS(eleStyle), ...FText.styles, ...FDiv.styles];
static styles = [unsafeCSS(eleStyle), unsafeCSS(globalStyle), ...FText.styles, ...FDiv.styles];

/**
* @attribute Gap is used to define the gap between the elements
Expand Down

0 comments on commit 162e288

Please sign in to comment.