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-file-upload 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 d4fd564 commit 3fad68b
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 27 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
$state-colors: (
"primary": var(--color-primary-default),
"success": var(--color-success-default),
"warning": var(--color-warning-default),
"danger": var(--color-danger-default)
);

$sizes: (
"medium": 12px,
"small": 8px
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// common mixins imported from this file
@import "./../../mixins/scss/mixins";
@import "./f-file-upload-variables";

f-file-upload {
width: 100%;
&[disabled] {
@include disabled();
}
@each $state, $color in $state-colors {
&[state="#{$state}"] {
@include input-color($state);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,23 +1,10 @@
@use "sass:map";

// common mixins imported from this file
@import "./../../mixins/scss/mixins";
@import "./f-file-upload-variables";
/**
START : scss maps to hold repsective attribute values
**/

$state-colors: (
"primary": var(--color-primary-default),
"success": var(--color-success-default),
"warning": var(--color-warning-default),
"danger": var(--color-danger-default)
);

$sizes: (
"medium": 12px,
"small": 8px
);

:host {
div.f-file-upload {
@include base();
Expand Down Expand Up @@ -104,15 +91,3 @@ $sizes: (
}
}
}

f-file-upload {
width: 100%;
&[disabled] {
@include disabled();
}
@each $state, $color in $state-colors {
&[state="#{$state}"] {
@include input-color($state);
}
}
}
11 changes: 10 additions & 1 deletion packages/flow-core/src/components/f-file-upload/f-file-upload.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { html, PropertyValueMap, unsafeCSS } from "lit";
import { property, query, queryAssignedElements } from "lit/decorators.js";
import eleStyle from "./f-file-upload.scss?inline";
import globalStyle from "./f-file-upload-global.scss?inline";
import { FRoot } from "../../mixins/components/f-root/f-root";
import { ref, createRef, Ref } from "lit/directives/ref.js";
import { FDiv } from "../f-div/f-div";
Expand All @@ -10,6 +11,8 @@ import { getExtensionsFromMimeType, getFormattedBytes } from "../../utils/index"
import { unsafeSVG } from "lit-html/directives/unsafe-svg.js";
import loader from "../../mixins/svg/loader";
import { flowElement } from "./../../utils";
import { injectCss } from "@cldcvr/flow-core-config";
injectCss("f-file-upload", globalStyle);

export type FFileUploadState = "primary" | "default" | "success" | "warning" | "danger";

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

/**
* @attribute f-file-upload has 2 type of modes: single and multiple. When type is single, a user can select only one file and the filename appears inline to the file uploader. When type is multiple, a user can select multiple files and each filename stacks under the file uploader.
Expand Down

0 comments on commit 3fad68b

Please sign in to comment.