Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(progress): add component tokens #8661

Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 29 additions & 6 deletions packages/calcite-components/src/components/progress/progress.scss
Original file line number Diff line number Diff line change
@@ -1,22 +1,42 @@
@import "../../assets/styles/animation";

/**
* CSS Custom Properties
*
* These properties can be overridden using the component's tag as selector.
*
* @prop --calcite-progress-background-color: defines the background color of the component.
* @prop --calcite-progress-bar-background-color: defines the background color of the progress bar.
Elijbet marked this conversation as resolved.
Show resolved Hide resolved
* @prop --calcite-progress-text-color: defines the text color of the component.
* @prop --calcite-progress-z-index: defines the z-index of the component.
Elijbet marked this conversation as resolved.
Show resolved Hide resolved
*/

:host {
@apply relative block w-full;
--calcite-progress-background-color: var(--calcite-color-border-3);
--calcite-progress-bar-background-color: var(--calcite-color-brand);
--calcite-progress-text-color: var(--calcite-color-text-2);
--calcite-progress-z-index: var(--calcite-z-index);

@apply relative block;
inline-size: var(--calcite-container-size-content-fluid);
}

.track,
.bar {
@apply absolute top-0;
block-size: 2px;

block-size: var(--calcite-size-xxxs);
z-index: var(--calcite-progress-z-index);
}

.track {
@apply z-default w-full overflow-hidden;
background: theme("borderColor.color.3");
@apply overflow-hidden;
inline-size: var(--calcite-container-size-content-fluid);
background-color: var(--calcite-progress-background-color);
}

.bar {
@apply bg-brand z-default;
background-color: var(--calcite-progress-bar-background-color);
}

@media (forced-colors: active) {
Expand All @@ -30,6 +50,7 @@

.indeterminate {
@apply w-1/5;

animation: looping-progress-bar-ani scaleDuration(--calcite-internal-animation-timing-medium, 11) linear infinite;
&.calcite--rtl {
animation-name: looping-progress-bar-ani-rtl;
Expand All @@ -42,7 +63,9 @@

.text {
@apply text-n2h px-0 pt-4 pb-0 text-center font-medium;
color: var(--calcite-color-text-2);

font-size: theme("fontSize.n2h");
color: var(--calcite-progress-text-color);
}

@keyframes looping-progress-bar-ani {
Expand Down
Loading