Skip to content

fix(countdown): update the v15 style #2843

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

Merged
merged 22 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
23 changes: 21 additions & 2 deletions src/packages/countdown/countdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,45 @@
align-items: center;
justify-content: center;
height: $countdown-height;
box-sizing: border-box;
font-weight: $coutdown-font-weight;
font-size: $countdown-font-size;
line-height: calc($countdown-font-size + 2px);
font-family: 'JD';
}
&-number,
&-number-primary {
position: relative;
min-width: $countdown-width;
padding: $countdown-number-padding;
border-radius: $countdown-number-border-radius;
margin: $countdown-number-margin;
text-align: center;
&::after {
content: '';
position: absolute;
top: -50%;
bottom: -50%;
left: -50%;
right: -50%;
transform: scale(0.5);
border-radius: calc($countdown-number-border-radius * 2);
}
}
&-number {
border: 1px solid $countdown-number-border-color;
background-color: $countdown-number-background-color;
color: $countdown-number-color;
&::after {
border: 1px solid $countdown-number-border-color;
}
}

&-number-primary {
border: 1px solid $countdown-number-primary-border-color;
background-color: $countdown-number-primary-background-color;
color: $countdown-number-primary-color;
&::after {
border: 1px solid $countdown-number-primary-border-color;
}
}
&-number-text {
border: 0;
Expand Down
2 changes: 1 addition & 1 deletion src/packages/countdown/countdown.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ const InternalCountDown: ForwardRefRenderFunction<
[`${classPrefix}-number-text`]: type === 'text',
})}
>
{unit ? padZero(time) : time}
{unit && unit !== 'DD' ? padZero(time) : time}
</View>
{unit ? (
<View className={`${classPrefix}-unit`}>{getUnit(unit)}</View>
Expand Down
2 changes: 2 additions & 0 deletions src/styles/theme-dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ page {
--nutui-color-primary-disabled-special: var(--nutui-brand-3);
// 品牌主色调镂空背景点击态
--nutui-color-primary-light-pressed: var(--nutui-brand-1);
--nutui-color-primary-specialdisabled: var(--nutui-red-3);

// service color
--nutui-golden-1: #fff2e0;
Expand Down Expand Up @@ -65,6 +66,7 @@ page {
// danger color
--nutui-red-1: #ffebef;
--nutui-red-2: #ff0f23;
--nutui-red-3: #ffadbe;
--nutui-red-6: #ff3b3b;

// danger color 语义化
Expand Down
2 changes: 2 additions & 0 deletions src/styles/theme-default.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ page {
--nutui-color-primary-disabled-special: var(--nutui-brand-3);
// 品牌主色调镂空背景点击态
--nutui-color-primary-light-pressed: var(--nutui-brand-1);
--nutui-color-primary-specialdisabled: var(--nutui-red-3);

// service color
--nutui-golden-1: #fff2e0;
Expand Down Expand Up @@ -63,6 +64,7 @@ page {

// danger color
--nutui-red-1: #ffebef;
--nutui-red-3: #ffadbe;
--nutui-red-2: #ff0f23;
--nutui-red-6: #ff3333;

Expand Down
6 changes: 5 additions & 1 deletion src/styles/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ $color-primary-gradient-1: linear-gradient(
) !default;
$color-primary-icon: var(--nutui-red-6, #ff3333) !default;
$color-primary-icon-disabled: var(--nutui-gray-8, #dadce0) !default;
$color-primary-specialdisabled: var(
--nutui-color-primary-specialdisabled,
#ffadbe
) !default;

// 默认色
$color-default: var(--nutui-color-default) !default;
Expand Down Expand Up @@ -803,7 +807,7 @@ $countdown-number-background-color: var(
) !default;
$countdown-number-border-color: var(
--nutui-countdown-number-border-color,
$color-primary-light-pressed
$color-primary-specialdisabled
) !default;
$countdown-number-primary-color: var(
--nutui-countdown-number-primary-color,
Expand Down
Loading