Skip to content

Commit

Permalink
feat(Popup): update css vars (#3035)
Browse files Browse the repository at this point in the history
* feat(Popup): update css vars

* fix: fix conflict

* fix: update demo

* test: update snapshots
  • Loading branch information
anlyyao authored Aug 5, 2024
1 parent 368af43 commit 2223cf7
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 5 deletions.
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

0 comments on commit 2223cf7

Please sign in to comment.