From 1a81a22b11a4362c248ba94f010ed819051f6d2b Mon Sep 17 00:00:00 2001 From: vikas-cldcvr Date: Sun, 8 Oct 2023 17:23:15 +0530 Subject: [PATCH] monorepo f-field global styles added --- .../src/components/f-field/f-field-global.scss | 12 ++++++++++++ .../flow-core/src/components/f-field/f-field.scss | 12 ------------ packages/flow-core/src/components/f-field/f-field.ts | 5 ++++- 3 files changed, 16 insertions(+), 13 deletions(-) create mode 100644 packages/flow-core/src/components/f-field/f-field-global.scss diff --git a/packages/flow-core/src/components/f-field/f-field-global.scss b/packages/flow-core/src/components/f-field/f-field-global.scss new file mode 100644 index 000000000..2654383ac --- /dev/null +++ b/packages/flow-core/src/components/f-field/f-field-global.scss @@ -0,0 +1,12 @@ +@import "./../../mixins/scss/mixins"; + +f-field { + width: 100%; + &[variant="inline"] { + flex: 0 0 auto; + width: fit-content; + } + &[disabled] { + @include disabled(); + } +} diff --git a/packages/flow-core/src/components/f-field/f-field.scss b/packages/flow-core/src/components/f-field/f-field.scss index 3aa7c26aa..c96f9cdf6 100644 --- a/packages/flow-core/src/components/f-field/f-field.scss +++ b/packages/flow-core/src/components/f-field/f-field.scss @@ -68,15 +68,3 @@ $sizes: ( } } } - -f-field { - width: 100%; - &[variant="inline"] { - flex: 0 0 auto; - width: fit-content; - } - &[disabled] { - @include disabled(); - } - // flex: 1 0 auto; -} diff --git a/packages/flow-core/src/components/f-field/f-field.ts b/packages/flow-core/src/components/f-field/f-field.ts index 3f2b02735..34169f524 100644 --- a/packages/flow-core/src/components/f-field/f-field.ts +++ b/packages/flow-core/src/components/f-field/f-field.ts @@ -4,7 +4,10 @@ import { FRoot } from "../../mixins/components/f-root/f-root"; import { FDiv } from "../f-div/f-div"; import { FText } from "../f-text/f-text"; import eleStyle from "./f-field.scss?inline"; +import globalStyle from "./f-field-global.scss?inline"; import { flowElement } from "./../../utils"; +import { injectCss } from "@cldcvr/flow-core-config"; +injectCss("f-field", globalStyle); export type FFieldStateProp = "default" | "primary" | "success" | "danger" | "warning"; /** @@ -15,7 +18,7 @@ export class FField extends FRoot { /** * css loaded from scss file */ - static styles = [unsafeCSS(eleStyle), ...FDiv.styles, ...FText.styles]; + static styles = [unsafeCSS(eleStyle), unsafeCSS(globalStyle), ...FDiv.styles, ...FText.styles]; /** * @attribute States on f-field are used to communicate purpose and it’s connotation.