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(Popup): update css vars #3035

Merged
merged 4 commits into from
Aug 5, 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
4 changes: 2 additions & 2 deletions script/generate-css-vars.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ if (combine[COMPONENT_NAME]) {
}

// 追加到文件
const cssVariableHeadContent = `\n\n### CSS Variables\n组件提供了下列 CSS 变量,可用于自定义样式。\n名称 | 默认值 | 描述 \n-- | -- | --\n`;
const cssVariableHeadContentEn = `\n\n### CSS Variables\nThe component provides the following CSS variables, which can be used to customize styles.\nName | Default Value | Description \n-- | -- | --\n`;
const cssVariableHeadContent = `\n\n### CSS Variables\n\n组件提供了下列 CSS 变量,可用于自定义样式。\n名称 | 默认值 | 描述 \n-- | -- | --\n`;
const cssVariableHeadContentEn = `\n\n### CSS Variables\n\nThe component provides the following CSS variables, which can be used to customize styles.\nName | Default Value | Description \n-- | -- | --\n`;

fs.appendFileSync(resolveCwd(`src/${COMPONENT_NAME}/README.md`), cssVariableHeadContent);
fs.appendFileSync(resolveCwd(`src/${COMPONENT_NAME}/README.en-US.md`), cssVariableHeadContentEn);
Expand Down
3 changes: 2 additions & 1 deletion src/popup/README.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ The component provides the following CSS variables, which can be used to customi
Name | Default Value | Description
-- | -- | --
--td-popup-bg-color | @bg-color-container | -
--td-popup-border-radius | @radius-default | -
--td-popup-border-radius | @radius-default | -
--td-popup-close-btn-color | @text-color-primary | -
3 changes: 2 additions & 1 deletion src/popup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,5 @@ t-class-content | 内容样式类
名称 | 默认值 | 描述
-- | -- | --
--td-popup-bg-color | @bg-color-container | -
--td-popup-border-radius | @radius-default | -
--td-popup-border-radius | @radius-default | -
--td-popup-close-btn-color | @text-color-primary | -
1 change: 1 addition & 0 deletions src/popup/__test__/__snapshots__/demo.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ exports[`Popup Popup base demo works fine 1`] = `
<base>
<t-popup
placement="top"
usingCustomNavbar="{{true}}"
visible=""
bind:visible-change="onVisibleChange"
>
Expand Down
7 changes: 6 additions & 1 deletion src/popup/_example/base/index.wxml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
<t-popup visible="{{visible}}" bind:visible-change="onVisibleChange" placement="{{cur.value || 'top'}}">
<t-popup
visible="{{visible}}"
usingCustomNavbar
bind:visible-change="onVisibleChange"
placement="{{cur.value || 'top'}}"
>
<view class="block block--{{cur.value}}">{{cur.text}}</view>
</t-popup>

Expand Down
3 changes: 3 additions & 0 deletions src/popup/popup.less
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
@popup-bg-color: var(--td-popup-bg-color, @bg-color-container);
@popup-border-radius: var(--td-popup-border-radius, @radius-default);

@popup-close-btn-color: var(--td-popup-close-btn-color, @text-color-primary);

.@{popup} {
position: fixed;
z-index: 11500;
Expand All @@ -25,6 +27,7 @@
right: 0;
padding: 20rpx;
line-height: 1;
color: @popup-close-btn-color;
}

&--top {
Expand Down
Loading