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

Open feat(theme/datasource&setting): change datasource and setting panel theme variable #928

Merged
merged 3 commits into from
Dec 13, 2024

Conversation

wenmine
Copy link
Collaborator

@wenmine wenmine commented Dec 6, 2024

English | 简体中文

PR

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our Commit Message Guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • Built its own designer, fully self-validated

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

Background and solution

此pr做的事情:

  1. 对齐数据源、右侧属性面板的全部模块变量
  2. 将数据源和属性面板部分文件里的变量滥用调整先调整为common变量

image

image

image

image

image

image

image
image
image
image
image

整体目的

  1. 消灭ti-lowcode的引用
  2. 消灭一个非通用变量被滥用的情况
  3. 亮色和暗色场景使用的变量一致,需要审视不一致的情况

剩余要做的事情:

  1. 将 对 light/base.less 和dark/base.less 变量的使用换成theme/base.less和common.less,不再单独分light和dark的base。替换之后,将light/base.less 和dark/base.less 文件删除
  2. 整理light和dark里面的模块变量,具体做法为:
    举例:
    image
    • 将模块less文件里的右侧值的部分,不再使用ti-lowcode-xxx,不再依赖其他的模块变量,只依赖common和base,保持模块变量的干净纯粹
    • 根据当前的场景和当前的值,去common里拿对应场景的common变量
    • 将里面写死颜色的地方,替换成common变量
    • 由于历史色值比较混乱的原因,所以可能会出现common变量和base变量里面没有的色值,这个时候,可以根据场景语义化,与设计师对齐,选择一个匹配的common变量进行修正。
    • 正常来说,dark和light的场景变量名应该的一致的,应该引用同一个common场景变量;后期要审视不一致的场景,与设计师对齐。看看是否可以调节成同一个场景的common变量。
  3. 整理 light/variable.less和dark/variable.less,目的是删除这两个文件,具体做法:
  4. 挨个查询当前在variable.less里的变量在哪里被使用,审视使用合理性,审视的做法是:
    • 若是没有地方用到,直接删除
    • 若是被模块变量文件用到了,则在模块文件里直接使用common变量即可
    • 若是被vue文件直接使用了,有两种修改方式:
      1.直接改成common变量,等待之后调整
      2.一步到位,看是哪一个模块的,然后新增模块变量,模块变量的值是common变量,然后vue文件使用的是模块变量。
  5. 最后,当variable.less和dark/base light/base.less都清理完之后,将模块变量回归到模块中。
  6. 模块变量回归模块后,再排查一遍该模块有没有直接使用--te-common的,有的话,需要转成模块变量。去保证整个链路是这样的: base/common less -> module less -> vue文件
  7. 将模块的--ti-lowcode 改名为--te-xxx 具体取名内部商量
  8. 需要单独审视,每个包与主题的关系和依赖,是否存在不依赖主题的情况,如:@opentiny/tiny-engine-setting-design,这种需要单独设置自己的变量。这块需要拉上chilling和qihex评审

注意点:需要看一下暗色主题
注意:对于一些分割线,使用的变量都是--te-common-border-divider,不要混用 --te-common-border-default了。可能需要全量排查一遍,可以排查分别设置 border-top,border-left, border-right,border-bottom的地方,看看有没有类似的分割线场景

image

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Summary by CodeRabbit

Summary by CodeRabbit

Release Notes

  • New Features

    • Enhanced styling across various components for improved visual consistency.
    • Updated hover effects and background colors for better user interaction feedback.
    • Introduced new props and functionalities in components for better configurability.
  • Bug Fixes

    • Resolved inconsistencies in color variables across themes, ensuring a unified appearance.
    • Fixed typographical errors in CSS variable names, improving styling accuracy.
  • Documentation

    • Updated comments and variable names to align with the new design system.
  • Chores

    • Refactored CSS variables to streamline theming and color management across the application.

Copy link
Contributor

coderabbitai bot commented Dec 6, 2024

Warning

Rate limit exceeded

@wenmine has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 0 minutes and 45 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between e8e6cf5 and cfa156d.

Walkthrough

The pull request introduces a series of cosmetic changes across multiple Vue components, primarily focusing on updating CSS styles to align with a new design system. Changes include modifications to color properties for various classes, ensuring a consistent visual appearance. The underlying functionality and logic of the components remain unchanged, with no alterations to props, methods, or event handling.

Changes

File Path Change Summary
packages/configurator/src/code-list-configurator/CodeListConfigurator.vue Updated color property for .source-code-header class.
packages/configurator/src/html-attributes-configurator/HtmlAttributesConfigurator.vue Modified color and background properties for .icon-wrap and .list-item classes.
packages/configurator/src/input-configurator/InputConfigurator.vue Changes in template for suffix icons, updates to props in script, and hover color in styles.
packages/configurator/src/layout-grid-configurator/LayoutGridConfigurator.vue Updated background and text colors for various classes.
packages/configurator/src/select-icon-configurator/SelectIconConfigurator.vue Modified color properties for .lowcode-icon and .tiny-svg classes.
packages/configurator/src/slider-configurator/SliderConfigurator.vue Updated background colors for slider handle and track.
packages/configurator/src/slot-configurator/SlotConfigurator.vue Changes in template structure, script logic, and style definitions.
packages/engine-cli/template/designer/src/configurators/MyInputConfigurator.vue Adjusted template and script for input handling, updated hover color in styles.
packages/plugins/datasource/src/DataSourceField.vue Corrected CSS variable typo in styles.
packages/plugins/datasource/src/DataSourceList.vue Updated text color and hover effects in styles.
packages/plugins/datasource/src/DataSourceRecordList.vue Modifications to template structure, script logic, and style adjustments.
packages/plugins/datasource/src/DataSourceRemoteDataResult.vue Changed border property for .monaco-editor class.
packages/plugins/datasource/src/DataSourceRemoteForm.vue Removed specific CSS styles without altering the component's logic.
packages/plugins/datasource/src/DataSourceRemotePanel.vue Removed specific CSS rules and minor adjustments in template structure.
packages/plugins/datasource/src/DataSourceRemoteParameter.vue Updated border color for the Monaco editor.
packages/plugins/datasource/src/DataSourceTemplate.vue Corrected CSS variable typo and updated border colors.
packages/plugins/datasource/src/DataSourceType.vue Modified color property for .svg-icon class.
packages/plugins/datasource/src/RemoteDataAdapterForm.vue Updated styles for .data-handle and .monaco-editor classes.
packages/materials/src/meta/block/src/BlockGroupSort.vue Updated color properties for .sort-text and .sort-caret classes.
packages/state/src/DataSourceRightPanel.vue Changes in template structure and updates to style definitions.
packages/settings/design/src/App.vue Removed and replaced several CSS variables related to color.
packages/settings/design/src/components/ArrayConfigItemForm.vue Updated color properties for title and form item labels.
packages/settings/design/src/components/PropertyCanvas.vue Updates to template structure, script logic, and style definitions.
packages/settings/design/src/components/PropertyList.vue Modified CSS class for list item color.
packages/settings/design/src/components/SettingPanel.vue Updates to template structure and styles, with minor logic adjustments.
packages/settings/events/src/components/BindEventsDialogContent.vue Style changes and minor adjustments to validation logic.
packages/settings/props/src/components/Empty.vue Updated color property for .empty-tips class.
packages/settings/props/src/components/groups/LifeCycle.vue Updates to CSS class properties and hover states.
packages/settings/props/src/components/groups/TableColumn.vue Modified color property for .top class.
packages/settings/props/src/components/groups/TablePager.vue Updated button text and modal handling logic.
packages/settings/props/src/components/inputs/DraggableOptions.vue Updated color property for .top class.
packages/settings/props/src/components/inputs/NumericSelect.vue Modified template structure and hover state color.
packages/settings/styles/src/Main.vue Updated color property for .line-text class.
packages/settings/styles/src/components/background/BackgroundGroup.vue Updates to template structure and script logic for managing background settings.
packages/settings/styles/src/components/background/ImageSetting.vue Modified color properties for text elements.
packages/settings/styles/src/components/background/RadialGradient.vue Updates to CSS variable changes for text color.
packages/settings/styles/src/components/border/BorderGroup.vue Updated SVG icon colors in styles.
packages/settings/styles/src/components/classNamesContainer/index.vue Updated color property for title class.
packages/settings/styles/src/components/inputs/ImageSelect.vue Updated color property for .icon class.
packages/settings/styles/src/components/inputs/InputSelect.vue Modified background color in styles.
packages/settings/styles/src/components/inputs/ModalMask.vue Updated color property for .modal-content class.
packages/settings/styles/src/components/inputs/NumericSelect.vue Updated background color and logic for handling numerical input.
packages/settings/styles/src/components/layout/GridBox.vue Added new styles and structural modifications for grid layout.
packages/settings/styles/src/components/layout/LayoutGroup.vue Modifications to template structure and removal of certain CSS classes.
packages/settings/styles/src/components/size/SizeGroup.vue Updated text color for various classes.
packages/settings/styles/src/components/spacing/SpacingGroup.vue Enhanced styling for margin and padding icons.
packages/settings/styles/src/components/spacing/SpacingSetting.vue Updated color properties for various classes.
packages/settings/styles/src/components/typography/TypographyGroup.vue Added new CSS rule for <span> elements within .typography-wrap class.
packages/settings/styles/src/components/typography/TypographyMore.vue Updates to template structure and significant style changes.
packages/theme/dark/datasource.less Comprehensive update to CSS custom properties for theming.
packages/theme/dark/settings.less Modifications to CSS variable declarations related to theming.
packages/theme/light/datasource.less Comprehensive update to CSS custom properties for theming.
packages/theme/light/settings.less Updates to CSS variable declarations related to theming.

Possibly related PRs

Suggested labels

refactoring, ready_for_review, refactor-main

Suggested reviewers

  • chilingling
  • hexqi

🐇 In a world of colors bright,
The components now take flight.
With hues that dance and play,
They brighten up the day!
From headers to buttons, all in line,
A visual feast, oh how divine! 🌈


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added the refactor-main refactor/develop branch feature label Dec 6, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 15

🧹 Outside diff range and nitpick comments (34)
packages/settings/props/src/components/groups/TablePager.vue (1)

Line range hint 74-74: Update remaining legacy theme variable

There's still a legacy theme variable (--ti-lowcode-toolbar-icon-color) that should be updated to match the new theme system.

- color: var(--ti-lowcode-toolbar-icon-color);
+ color: var(--te-common-text-secondary);
packages/settings/styles/src/components/layout/LayoutGroup.vue (1)

Line range hint 139-139: Replace legacy theme variable

The background color still uses the legacy --ti-lowcode-style-setting-label-bg variable, which doesn't align with the PR's objective of eliminating "ti-lowcode" references and standardizing theme variables.

Consider replacing with an appropriate --te-common-* variable:

-        background-color: var(--ti-lowcode-style-setting-label-bg);
+        background-color: var(--te-common-bg-emphasize);
packages/settings/styles/src/Main.vue (2)

Line range hint 239-267: Standardize remaining theme variables

There are several other --ti-lowcode prefixed variables that should be updated to use common theme variables for consistency:

  • --ti-lowcode-setting-style-btn-font-color
  • --ti-lowcode-setting-style-btn-border-color
  • --ti-lowcode-setting-style-input-bg
  • --ti-lowcode-setting-style-input-font-color

This aligns with the PR objective to "eliminate references to ti-lowcode" and standardize variables between light and dark themes.

Consider updating these variables to their corresponding common theme variables. For example:

.tiny-button {
-  color: var(--ti-lowcode-setting-style-btn-font-color);
+  color: var(--te-common-text-primary);
}
.tiny-button:hover {
  background: none;
-  border-color: var(--ti-lowcode-setting-style-btn-border-color);
+  border-color: var(--te-common-border-light);
}
.inline-bind-style {
  :deep(.tiny-input__inner) {
-    background: var(--ti-lowcode-setting-style-input-bg);
-    color: var(--ti-lowcode-setting-style-input-font-color);
-    border-color: var(--ti-lowcode-setting-style-input-bg);
+    background: var(--te-common-bg-dark);
+    color: var(--te-common-text-primary);
+    border-color: var(--te-common-border-light);
  }
}

Line range hint 223-235: Consider consolidating color definitions

The style block for .line-style has a color definition that appears redundant with the .line-text color:

.line-style {
  color: var(--ti-lowcode-setting-style-font-color);  // This might be unnecessary
  .line-text {
    color: var(--te-common-text-secondary);
  }
}

Consider removing the parent color if it's not being used by other elements.

packages/settings/styles/src/components/background/BackgroundGroup.vue (1)

Line range hint 424-424: Migrate remaining ti-lowcode variables to common variables

Several CSS variables still use the "ti-lowcode" prefix, which should be migrated to common variables according to the PR objectives:

  • --ti-lowcode-optionitem-background-color
  • --ti-lowcode-setting-style-drag-bar-bg
  • --ti-lowcode-style-setting-label-bg

Consider replacing these with appropriate common variables from the design system. For example:

- background-color: var(--ti-lowcode-optionitem-background-color);
+ background-color: var(--te-common-bg-container);

- background-color: var(--ti-lowcode-setting-style-drag-bar-bg);
+ background-color: var(--te-common-bg-emphasize);

- background-color: var(--ti-lowcode-style-setting-label-bg);
+ background-color: var(--te-common-bg-emphasize);

Please verify these suggested replacements with the design specifications to ensure they match the intended visual appearance.

Also applies to: 476-476, 489-489, 583-583

packages/settings/styles/src/components/background/ImageSetting.vue (1)

Line range hint 315-330: Review button interaction consistency

While the theme variable changes from ti-lowcode to te-common prefixes are good, there's a potential UX inconsistency:

  • The button has clickable styling (border, centered text)
  • But it's set to cursor: default which suggests non-interactivity

Consider one of these approaches:

  1. If the button should be interactive:
-  cursor: default;
+  cursor: pointer;
  1. If the button should be non-interactive:
-  border-width: 1px;
-  border-style: solid;
+  background-color: var(--te-common-bg-disabled);
+  color: var(--te-common-text-disabled);
packages/settings/styles/src/components/layout/GridBox.vue (2)

Line range hint 530-562: Update theme variables to align with new standards

The code is still using the old --ti-lowcode- prefixed variables which should be updated according to the PR objectives. Consider replacing them with the new common theme variables.

Apply this diff to update the theme variables:

  .is-setting {
-   color: var(--ti-lowcode-style-setting-label-color);
-   background-color: var(--ti-lowcode-style-setting-label-bg);
+   color: var(--te-common-text-primary);
+   background-color: var(--te-common-bg-selected);
  }

Line range hint 479-489: Additional theme variables need updating

There are more instances of old theme variables that should be updated for consistency:

Apply this diff to update the remaining theme variables:

  .grid-edit-btn {
    /* ... other properties ... */
-   border: 1px solid var(--ti-lowcode-tabs-border-color);
-   color: var(--ti-lowcode-grid-edit-color);
-   background: var(--ti-lowcode-grid-edit-bg);
+   border: 1px solid var(--te-common-border-color);
+   color: var(--te-common-text-secondary);
+   background: var(--te-common-bg-container);
    /* ... other properties ... */
  }
packages/plugins/datasource/src/RemoteDataAdapterForm.vue (1)

Line range hint 68-68: Standardize the icon color variable

The icon color still uses the old ti-lowcode prefix (var(--ti-lowcode-datasource-toolbar-icon-color)), while other variables have been updated to use the new te-common prefix.

Consider updating to a common theme variable to maintain consistency:

-    color: var(--ti-lowcode-datasource-toolbar-icon-color);
+    color: var(--te-common-text-secondary);
packages/engine-cli/template/designer/src/configurators/MyInputConfigurator.vue (2)

Line range hint 1-4: Implement suffix icons rendering

The component accepts suffixIcons as a prop but doesn't render them in the template. This creates a disconnect between the component's API and its implementation.

Consider implementing the suffix icons like this:

 <tiny-input v-model="value" :type="type" :placeholder="placeholder" :rows="rows" @update:modelValue="change">
+  <template #suffix>
+    <span v-for="(icon, index) in suffixIcons" :key="index" class="tiny-svg-size">
+      <component :is="icon" />
+    </span>
+  </template>
 </tiny-input>

Line range hint 1-1: Consider internationalizing the hardcoded Chinese text

The text "我是自定义的 input configurator" should be internationalized to support multiple languages.

Consider using a translation key:

-<span>我是自定义的 input configurator</span>
+<span>{{ t('configurator.customInput.title') }}</span>
packages/plugins/state/src/DataSourceRightPanel.vue (1)

Theme variable changes need to be updated consistently

The search results show that the new --te-common-* theme variables are only used in the file under review, while the rest of the codebase is still using the old --ti-lowcode-* theme variables. This inconsistency should be addressed to maintain a uniform theming system.

  • packages/plugins/state/src/DataSourceRightPanel.vue is using new --te-common-* variables
  • Multiple other files are still using the old --ti-lowcode-* variables
  • The theme definitions in packages/theme/light/ and packages/theme/dark/ are using the old variable system
🔗 Analysis chain

Line range hint 116-130: Verify theme variable changes across the codebase

Let's ensure these theme variable changes are consistent with other components and that we haven't missed any occurrences.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining old theme variables that should be updated
echo "Checking for remaining ti-lowcode theme variables..."
rg --type=vue "var\(--ti-lowcode-[^)]+\)" packages/

# Search for usage of new theme variables to ensure consistency
echo "Checking usage of new theme variables..."
rg --type=vue "var\(--te-common-[^)]+\)" packages/

Length of output: 368


Script:

#!/bin/bash
# Search for any remaining old theme variables that should be updated
echo "Checking for remaining ti-lowcode theme variables..."
rg "var\(--ti-lowcode-[^)]+\)" packages/

# Search for usage of new theme variables to ensure consistency
echo "Checking usage of new theme variables..."
rg "var\(--te-common-[^)]+\)" packages/

Length of output: 81953

packages/configurator/src/slot-configurator/SlotConfigurator.vue (2)

Line range hint 89-93: Consider internationalizing modal messages

The confirmation modal messages are hardcoded in Chinese. Consider extracting these strings to a localization system for better maintainability and internationalization support.

Example approach:

- title: '提示',
- message: '关闭后插槽内的内容将被清空,是否继续?',
+ title: t('common.hint'),
+ message: t('slot.confirmUnbind'),

Line range hint 151-207: Consider using TinyVue Switch component

The current implementation uses a custom switch styling. Consider using the @opentiny/vue Switch component for consistency with the design system and to reduce maintenance overhead.

Example approach:

- <div :class="['e__switch', { 'e_is-checked': slot.bind }]">
-   <span class="e__switch-core" @click="toggleSlot(slot, index)"></span>
- </div>
+ <tiny-switch
+   v-model="slot.bind"
+   @change="(val) => toggleSlot(slot, index)"
+ />

This would also allow removing the custom switch styles (lines 151-207).

packages/plugins/datasource/src/DataSourceList.vue (1)

Line range hint 142-180: Consider updating remaining legacy theme variables in future PRs.

Several other --ti-lowcode-* prefixed variables are still present in the styles:

  • --ti-lowcode-data-source-border-color
  • --ti-lowcode-datasource-tabs-border-color
  • --ti-lowcode-datasource-common-text-main-color
  • --ti-lowcode-datasource-list-hover-color
  • --ti-lowcode-datasource-toolbar-more-hover-color

These could be standardized in future PRs to maintain consistency with the new theme system.

packages/settings/styles/src/components/spacing/SpacingGroup.vue (2)

6-6: Improved theme consistency with semantic class names

The transition from hardcoded colors to CSS variables and more semantic class names (padding-color/margin-color) improves maintainability and theme consistency.

Consider adding ARIA attributes for better accessibility:

 <svg
   xmlns="http://www.w3.org/2000/svg"
   fill="currentColor"
   width="256"
   height="120"
+  role="img"
+  aria-label="Spacing Editor"
   style="grid-area: 1 / 1 / -1 / -1"
   class="margin-color"
 >

Also applies to: 10-10, 25-25, 43-43, 61-61, 79-79


84-118: Consider optimizing SVG styles and values

The clipPath implementation is correct, but there's room for improvement in maintainability and DRY principles.

Consider these optimizations:

  1. Move repeated style attributes to CSS classes:
<style lang="less" scoped>
+ .clip-path-base {
+   pointer-events: none;
+   fill: currentColor;
+ }
</style>

<clipPath id="margin-outer" class="margin-color">
  <rect
    x="0"
    y="0"
    width="256"
    height="120"
-   fill="currentColor"
-   rx="4"
-   ry="4"
-   style="pointer-events: none"
+   class="clip-path-base"
  ></rect>
</clipPath>
  1. Consider using CSS variables for repeated values:
<style lang="less" scoped>
.spacing-wrap {
+  --spacing-border-radius: 4px;
+  --spacing-rect-width: 256px;
+  --spacing-rect-height: 120px;
}
</style>

Also applies to: 267-301

packages/configurator/src/slider-configurator/SliderConfigurator.vue (1)

Line range hint 116-126: Update remaining tooltip styles to use standardized variables

The tooltip styles still use the old --ti-lowcode-* prefix variables, which should be updated to maintain consistency with the PR's objective of removing all ti-lowcode references.

Consider updating these styles:

.tiny-slider__tips {
-  color: var(--ti-lowcode-breadcrumb-color);
-  background: var(--ti-lowcode-breadcrumb-bg);
+  color: var(--te-common-text-primary);
+  background: var(--te-common-bg-popup);
  padding: 4px 6px;
  border-radius: 2px;
  box-shadow: rgb(0 0 0 / 15%) 0px 5px 10px;
  margin-top: -8px;
  &::before,
  &::after {
-    border-color: var(--ti-lowcode-breadcrumb-bg) transparent;
+    border-color: var(--te-common-bg-popup) transparent;
  }
}
packages/settings/styles/src/components/background/RadialGradient.vue (2)

Line range hint 149-149: Standardize remaining theme variable

There's still one instance of the old variable naming pattern that should be updated for consistency.

- color: var(--ti-lowcode-common-third-text-color);
+ color: var(--te-common-text-tertiary);

Line range hint 73-86: Consider documenting complex regex patterns

The gradient parsing logic uses sophisticated regex patterns that would benefit from documentation explaining their purpose and matching patterns. Consider adding JSDoc comments to explain:

  • What patterns each regex matches
  • Example inputs and outputs
  • Edge cases handled

Example documentation:

/**
 * Regex patterns for parsing radial gradient syntax:
 * - rExtentKeyword: Matches size keywords (e.g., 'closest-side')
 * - rPosition: Matches position percentages (e.g., '50% 50%')
 * - rGradientCapture: Combines above patterns to match full gradient syntax
 * 
 * Example input: "circle closest-side at 50% 50%, #fff 0%, #000 100%"
 */
packages/plugins/datasource/src/DataSourceRecordList.vue (3)

Line range hint 359-365: Remove hardcoded color variable in confirmation dialog

The confirmation dialog is using a hardcoded color variable --ti-lowcode-datasource-modal-text-color which contradicts the PR's objective of standardizing theme variables. This should be updated to use the new common theme variables.

  const messageSaved = {
    render: () => (
      <span>
-       <span style="color:var(--ti-lowcode-datasource-modal-text-color)">{'您确定要删除该条数据吗?'}</span>
+       <span style="color:var(--te-common-text-primary)">{'您确定要删除该条数据吗?'}</span>
      </span>
    )
  }

Line range hint 466-484: Enhance error handling in saveRecordFormData

The error handling in the saveRecordFormData function could be improved. Currently, it silently returns on error without notifying the user.

  const saveRecordFormData = (data) => {
    const {
      name,
      id,
      data: { columns, type, ...other }
    } = props.data

    const requestData = { name, id, data: { columns, type, ...other, data } }

    requestUpdateDataSource(props.data.id, requestData).then((res) => {
      if (!res) {
+       useNotify({
+         type: 'error',
+         message: '数据源修改失败'
+       })
        return
      }

      const key = `datasource${capitalize(camelize(name))}`
      const pageSchema = useCanvas().canvasApi.value.getSchema()

      if (pageSchema.state[key]) {
        pageSchema.state[key] = data.map(({ _id, ...other }) => other)
      }

      useNotify({
        type: 'success',
        message: '数据源修改成功'
      })

      fetchData(true)
+   }).catch(error => {
+     useNotify({
+       type: 'error',
+       message: `数据源修改失败: ${error.message}`
+     })
    })
  }

Line range hint 644-696: Standardize remaining theme variables

There are several remaining instances of ti-lowcode prefixed variables that should be updated to use the new standardized theme variables:

  • --ti-lowcode-datasource-dialog-demo-border-color
  • --ti-lowcode-datasource-common-hover-bg-1
  • --ti-lowcode-datasource-common-primary-text-color
  • --ti-lowcode-datasource-toolbar-breadcrumb-color
  • --ti-lowcode-datasource-icon-hover-bg
  • --ti-lowcode-datasource-toolbar-icon-color

This will ensure consistency with the PR's objective of standardizing theme variables across all modules.

packages/settings/design/src/components/SettingPanel.vue (2)

273-276: Consider optimizing border styling

While the border color variable change is good, having both top and bottom borders might create double borders between adjacent items. Consider using only one border direction consistently.

 .option-item {
-  border-top: 1px solid var(--te-common-border-default);
+  border-bottom: 1px solid var(--te-common-border-default);
 }
-.option-item:last-child {
-  border-bottom: 1px solid var(--te-common-border-default);
-}

Replace remaining --ti-lowcode-setting-plugin-icon-color variable with the standardized equivalent

The verification found one remaining ti-lowcode prefixed CSS variable that needs to be updated:

  • Line 384: Replace --ti-lowcode-setting-plugin-icon-color with the appropriate --te- prefixed variable
🔗 Analysis chain

Line range hint 1-391: Verify complete removal of ti-lowcode variables

Let's verify that we've caught all ti-lowcode variables that need to be replaced.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining ti-lowcode variables in the file
rg --type less "ti-lowcode" packages/settings/design/src/components/SettingPanel.vue

Length of output: 144

packages/settings/styles/src/components/typography/TypographyMore.vue (1)

Line range hint 1-74: Consider enhancing accessibility with ARIA labels

While the template structure is well-organized, consider improving accessibility by:

  • Adding aria-label attributes to interactive elements
  • Using more descriptive labels instead of empty for attributes
  • Adding proper ARIA roles where appropriate

Example improvements:

- <label for="">Letter spacing</label>
+ <label for="letter-spacing" aria-label="Letter spacing">Letter spacing</label>
+ <numeric-select id="letter-spacing" aria-label="Adjust letter spacing"></numeric-select>
packages/settings/design/src/components/PropertyCanvas.vue (2)

Line range hint 275-279: Standardize remaining theme variables

While text colors have been updated to use common variables, several background and border color variables still use the old ti-lowcode prefix. This should be updated for consistency.

Consider updating these variables:

- background: var(--ti-lowcode-tabs-active-bg);
- border-bottom: 1px solid var(--ti-lowcode-tabs-border-color);
+ background: var(--te-common-bg-container);
+ border-bottom: 1px solid var(--te-common-border-color);

&.active {
-  background-color: var(--ti-lowcode-common-hover-bg-color);
+  background-color: var(--te-common-bg-hover);
}

Also applies to: 282-286


Line range hint 1-316: Consider a systematic approach to theme variable migration

While this file shows good progress in standardizing theme variables, a systematic approach would ensure consistency across all components. Consider:

  1. Creating a mapping document between old and new variable names
  2. Using a CSS preprocessor or PostCSS plugin to automate the migration
  3. Adding lint rules to prevent the use of deprecated variable prefixes

This would help maintain consistency and prevent the reintroduction of old variable patterns.

packages/settings/styles/src/components/inputs/ModalMask.vue (2)

96-96: Consider standardizing remaining theme variables

For consistency with the PR's objective of removing "ti-lowcode" references, consider updating these variables to use the new common variable system:

  • var(--ti-lowcode-tabs-border-color)
  • var(--ti-modal-padding-y)
  • var(--ti-modal-padding-x)
-    border: 1px solid var(--ti-lowcode-tabs-border-color);
+    border: 1px solid var(--te-common-border-color);
...
-    padding: var(--ti-modal-padding-y, 14px) var(--ti-modal-padding-x, 20px);
+    padding: var(--te-common-spacing-m, 14px) var(--te-common-spacing-l, 20px);

Also applies to: 108-109


Line range hint 112-114: Fix typo in CSS variable name

There's a typo in the CSS variable name: --modal-spaceing should be --modal-spacing

    left: calc(
-      100% - var(--modal-right-offset, 287px) - var(--modal-right-offset, 280px) - var(--modal-spaceing, 16px)
+      100% - var(--modal-right-offset, 287px) - var(--modal-right-offset, 280px) - var(--modal-spacing, 16px)
    );
packages/settings/design/src/App.vue (1)

Line range hint 152-157: Consider migrating remaining ti-lowcode variables.

For consistency with the new design system, consider migrating these variables to their --te-* equivalents:

-  --ti-lowcode-common-secondary-text-color: #adb0b8;
-  --ti-lowcode-common-border-color: #dfe1e6;
-  --ti-lowcode-common-hover-bg-color: #f2f5fc;
-  --ti-lowcode-mask-bg: #fafafa;
+  --te-common-text-secondary: #adb0b8;
+  --te-common-border: #dfe1e6;
+  --te-common-bg-hover: #f2f5fc;
+  --te-common-bg-mask: #fafafa;
packages/theme/dark/datasource.less (1)

28-28: Remove light theme comment from dark theme file

The comment // light appears in the dark theme file, which is confusing and incorrect.

Remove the misplaced comment:

- --ti-lowcode-datasource-label-color: var(--te-common-text-secondary); // light
+ --ti-lowcode-datasource-label-color: var(--te-common-text-secondary);
packages/theme/light/datasource.less (1)

2-39: Consider consolidating redundant color variables

Several variables appear to serve similar purposes and could potentially be consolidated:

  1. Error colors:
    • --ti-lowcode-datasource-description-error-color
    • --ti-lowcode-datasource-common-error-color
    • --ti-lowcode-datasource-error-tip-color
  2. Text colors:
    • --ti-lowcode-datasource-common-text-main-color
    • --ti-lowcode-datasource-common-primary-text-color

Consider consolidating these variables to reduce maintenance overhead and improve consistency. For example:

- --ti-lowcode-datasource-description-error-color
- --ti-lowcode-datasource-common-error-color
- --ti-lowcode-datasource-error-tip-color
+ --ti-lowcode-datasource-error-color

- --ti-lowcode-datasource-common-text-main-color
- --ti-lowcode-datasource-common-primary-text-color
+ --ti-lowcode-datasource-text-color
packages/theme/dark/settings.less (1)

18-30: LGTM! Consider consolidating similar variables

The color variables are well-organized and follow a consistent pattern. However, some variables could potentially be consolidated to reduce duplication, such as error-related colors that share the same values.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 3421b0f and e8e6cf5.

📒 Files selected for processing (53)
  • packages/configurator/src/code-list-configurator/CodeListConfigurator.vue (1 hunks)
  • packages/configurator/src/html-attributes-configurator/HtmlAttributesConfigurator.vue (2 hunks)
  • packages/configurator/src/input-configurator/InputConfigurator.vue (1 hunks)
  • packages/configurator/src/layout-grid-configurator/LayoutGridConfigurator.vue (3 hunks)
  • packages/configurator/src/select-icon-configurator/SelectIconConfigurator.vue (1 hunks)
  • packages/configurator/src/slider-configurator/SliderConfigurator.vue (1 hunks)
  • packages/configurator/src/slot-configurator/SlotConfigurator.vue (1 hunks)
  • packages/engine-cli/template/designer/src/configurators/MyInputConfigurator.vue (1 hunks)
  • packages/plugins/datasource/src/DataSourceField.vue (1 hunks)
  • packages/plugins/datasource/src/DataSourceList.vue (2 hunks)
  • packages/plugins/datasource/src/DataSourceRecordList.vue (2 hunks)
  • packages/plugins/datasource/src/DataSourceRemoteDataResult.vue (1 hunks)
  • packages/plugins/datasource/src/DataSourceRemoteForm.vue (0 hunks)
  • packages/plugins/datasource/src/DataSourceRemotePanel.vue (0 hunks)
  • packages/plugins/datasource/src/DataSourceRemoteParameter.vue (1 hunks)
  • packages/plugins/datasource/src/DataSourceTemplate.vue (2 hunks)
  • packages/plugins/datasource/src/DataSourceType.vue (1 hunks)
  • packages/plugins/datasource/src/RemoteDataAdapterForm.vue (2 hunks)
  • packages/plugins/materials/src/meta/block/src/BlockGroupSort.vue (1 hunks)
  • packages/plugins/state/src/DataSourceRightPanel.vue (2 hunks)
  • packages/settings/design/src/App.vue (1 hunks)
  • packages/settings/design/src/components/ArrayConfigItemForm.vue (1 hunks)
  • packages/settings/design/src/components/PropertyCanvas.vue (6 hunks)
  • packages/settings/design/src/components/PropertyList.vue (1 hunks)
  • packages/settings/design/src/components/SettingPanel.vue (3 hunks)
  • packages/settings/events/src/components/BindEventsDialogContent.vue (3 hunks)
  • packages/settings/props/src/components/Empty.vue (1 hunks)
  • packages/settings/props/src/components/groups/LifeCycle.vue (5 hunks)
  • packages/settings/props/src/components/groups/TableColumn.vue (1 hunks)
  • packages/settings/props/src/components/groups/TablePager.vue (1 hunks)
  • packages/settings/props/src/components/inputs/DraggableOptions.vue (1 hunks)
  • packages/settings/props/src/components/inputs/NumericSelect.vue (0 hunks)
  • packages/settings/styles/src/Main.vue (1 hunks)
  • packages/settings/styles/src/components/background/BackgroundGroup.vue (1 hunks)
  • packages/settings/styles/src/components/background/ImageSetting.vue (3 hunks)
  • packages/settings/styles/src/components/background/RadialGradient.vue (1 hunks)
  • packages/settings/styles/src/components/border/BorderGroup.vue (1 hunks)
  • packages/settings/styles/src/components/classNamesContainer/index.vue (1 hunks)
  • packages/settings/styles/src/components/inputs/ImageSelect.vue (1 hunks)
  • packages/settings/styles/src/components/inputs/InputSelect.vue (1 hunks)
  • packages/settings/styles/src/components/inputs/ModalMask.vue (1 hunks)
  • packages/settings/styles/src/components/inputs/NumericSelect.vue (1 hunks)
  • packages/settings/styles/src/components/layout/GridBox.vue (2 hunks)
  • packages/settings/styles/src/components/layout/LayoutGroup.vue (1 hunks)
  • packages/settings/styles/src/components/size/SizeGroup.vue (2 hunks)
  • packages/settings/styles/src/components/spacing/SpacingGroup.vue (12 hunks)
  • packages/settings/styles/src/components/spacing/SpacingSetting.vue (3 hunks)
  • packages/settings/styles/src/components/typography/TypographyGroup.vue (1 hunks)
  • packages/settings/styles/src/components/typography/TypographyMore.vue (3 hunks)
  • packages/theme/dark/datasource.less (1 hunks)
  • packages/theme/dark/settings.less (1 hunks)
  • packages/theme/light/datasource.less (1 hunks)
  • packages/theme/light/settings.less (1 hunks)
💤 Files with no reviewable changes (3)
  • packages/plugins/datasource/src/DataSourceRemoteForm.vue
  • packages/plugins/datasource/src/DataSourceRemotePanel.vue
  • packages/settings/props/src/components/inputs/NumericSelect.vue
✅ Files skipped from review due to trivial changes (22)
  • packages/settings/styles/src/components/typography/TypographyGroup.vue
  • packages/plugins/datasource/src/DataSourceType.vue
  • packages/settings/styles/src/components/inputs/InputSelect.vue
  • packages/settings/styles/src/components/size/SizeGroup.vue
  • packages/plugins/materials/src/meta/block/src/BlockGroupSort.vue
  • packages/plugins/datasource/src/DataSourceRemoteParameter.vue
  • packages/settings/styles/src/components/border/BorderGroup.vue
  • packages/settings/props/src/components/groups/TableColumn.vue
  • packages/settings/styles/src/components/classNamesContainer/index.vue
  • packages/plugins/datasource/src/DataSourceTemplate.vue
  • packages/plugins/datasource/src/DataSourceField.vue
  • packages/configurator/src/html-attributes-configurator/HtmlAttributesConfigurator.vue
  • packages/configurator/src/code-list-configurator/CodeListConfigurator.vue
  • packages/settings/design/src/components/PropertyList.vue
  • packages/settings/design/src/components/ArrayConfigItemForm.vue
  • packages/configurator/src/layout-grid-configurator/LayoutGridConfigurator.vue
  • packages/plugins/datasource/src/DataSourceRemoteDataResult.vue
  • packages/settings/styles/src/components/inputs/ImageSelect.vue
  • packages/settings/props/src/components/inputs/DraggableOptions.vue
  • packages/settings/props/src/components/groups/LifeCycle.vue
  • packages/settings/styles/src/components/spacing/SpacingSetting.vue
  • packages/settings/events/src/components/BindEventsDialogContent.vue
🔇 Additional comments (39)
packages/settings/props/src/components/groups/TablePager.vue (1)

65-65: LGTM: Theme variable update aligns with standardization effort

The change from --ti-lowcode-toolbar-breadcrumb-color to --te-common-text-secondary correctly implements the new theme system as outlined in the PR objectives.

packages/settings/styles/src/components/layout/LayoutGroup.vue (1)

132-132: LGTM: Appropriate use of common theme variable

The change correctly implements the standardized theme variable --te-common-text-secondary for text color, aligning with the PR's objective of using common variables.

packages/configurator/src/select-icon-configurator/SelectIconConfigurator.vue (2)

110-111: LGTM: Theme variable updates align with standardization effort

The changes correctly implement the new common theme variables:

  • --te-common-bg-prompt for background
  • --te-common-text-secondary for text color

This aligns with the PR objective of standardizing theme variables across modules.


118-118: LGTM: Icon color standardization

The icon color now uses the standardized --te-common-text-secondary variable, maintaining consistency with the parent text color.

packages/settings/styles/src/Main.vue (1)

232-232: LGTM! Variable change aligns with standardization goals.

The change from --ti-lowcode-setting-style-title-color to --te-common-text-secondary aligns with the PR objective to standardize theme variables.

packages/settings/props/src/components/Empty.vue (2)

39-39: LGTM! Theme variable change aligns with standardization effort.

The change from --ti-lowcode-common-text-color-5 to --te-common-text-weaken follows the new semantic naming convention and removes the deprecated "ti-lowcode" prefix.


39-39: Verify the new theme variable is properly defined.

Let's ensure the new --te-common-text-weaken variable is properly defined in the theme files.

✅ Verification successful

Theme variable --te-common-text-weaken is properly defined and used

The variable is well-defined in the base theme with appropriate color values:

  • Light theme: --te-base-gray-60 (#808080)
  • Dark theme: --te-base-gray-120 (#8B8C8F)

It's also being used consistently across multiple theme files as a replacement for older variables, including the specific use case in datasource theme files where it replaces --ti-lowcode-common-text-color-5.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if the new theme variable is defined in theme files
# Expected: Find definition of --te-common-text-weaken in theme files

# Search for the variable definition in less/css files
rg --type=less --type=css "te-common-text-weaken"

# Search for any remaining old variable references that might have been missed
rg --type=less --type=css "ti-lowcode-common-text-color-5"

Length of output: 4235

packages/settings/styles/src/components/background/BackgroundGroup.vue (1)

401-401: LGTM! Color variable change aligns with design system

The change to use --te-common-text-secondary aligns well with the standardization of theme variables.

packages/configurator/src/input-configurator/InputConfigurator.vue (2)

69-69: LGTM! Variable change aligns with theme standardization

The change from --ti-lowcode-dialog-font-color to --te-common-text-primary aligns well with the PR objectives of standardizing theme variables and removing "ti-lowcode" references.


69-69: Verify the new theme variable implementation

Let's ensure the new --te-common-text-primary variable is properly defined and consistently used across themes.

✅ Verification successful

The new theme variable implementation is properly defined and consistent

The variable --te-common-text-primary is well-defined in the theme system:

  • Defined in base theme for both light and dark modes with appropriate color values
  • Consistently used across multiple components
  • Part of a comprehensive text color system including other variables like secondary, weaken, disabled, etc.
  • Properly replacing the old variable --ti-lowcode-dialog-font-color
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the new theme variable implementation and usage

# Check for the variable definition in theme files
echo "Checking for variable definition in theme files..."
rg --type=less "te-common-text-primary"

# Check for any remaining old variable usage
echo "Checking for any remaining old variable usage..."
rg --type=less "ti-lowcode-dialog-font-color"

# Look for similar color variables to ensure consistency
echo "Checking for similar color variable patterns..."
rg --type=less "te-common-text-[a-z]+"

Length of output: 24656

packages/settings/styles/src/components/background/ImageSetting.vue (1)

291-291: LGTM: Theme variable standardization

The color variable change from --ti-lowcode-common-text-color-2 to --te-common-text-secondary aligns with the PR's objective of standardizing theme variables across modules.

packages/settings/styles/src/components/layout/GridBox.vue (1)

563-566: LGTM!

The padding values are consistent and provide appropriate spacing for the grid edit section.

packages/plugins/datasource/src/RemoteDataAdapterForm.vue (3)

59-59: LGTM: Font size standardization

The font size change aligns with the PR's objective to standardize theme variables.


75-75: LGTM: Border color standardization

The border color change aligns with the standardization effort.


62-62: LGTM: Theme variable standardization

The change from a specific datasource variable to a common text variable aligns with the PR's goal of standardizing theme variables.

✅ Verification successful

Theme variable is properly defined and widely used

The variable --te-common-text-secondary is well-defined in the base theme (packages/theme/base/src/common.less) and is extensively used across both light and dark themes, including in datasource-related styles. The variable is properly mapped to base color values:

  • Light theme: --te-base-gray-70 (#595959)
  • Dark theme: --te-base-gray-110 (#B4B5B8)
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Verify the new theme variable is defined in theme files
rg "te-common-text-secondary" --type less

Length of output: 3578

packages/plugins/datasource/src/DataSourceList.vue (1)

155-155: LGTM! Theme variable update aligns with standardization effort.

The change from specific color variable to semantic theme variable --te-common-text-primary improves consistency.

Let's verify consistent usage of this new variable across related components:

✅ Verification successful

Theme variable update is consistent with the design system

The change from --ti-lowcode-base-gray-90 to --te-common-text-primary is part of a broader theme standardization effort. The search results confirm:

  • The new variable --te-common-text-primary is properly defined in the theme system (packages/theme/base/src/common.less) for both light and dark themes
  • It's widely adopted across multiple components for primary text styling
  • The old variable --ti-lowcode-base-gray-90 is only used in theme definition files, not directly in components
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining old variable usage
rg "ti-lowcode-base-gray-90" --type=vue

# Verify adoption of new variable
rg "te-common-text-primary" --type=vue

Length of output: 134


Script:

#!/bin/bash
# Search for any remaining old variable usage without file type restriction
rg "ti-lowcode-base-gray-90"

# Verify adoption of new variable
rg "te-common-text-primary"

Length of output: 10521

packages/configurator/src/slider-configurator/SliderConfigurator.vue (4)

98-98: LGTM: Theme variable update aligns with standardization effort

The background-color property now uses the standardized --te-common-bg-container variable, which is consistent with the PR's objective of unifying theme variables.


106-106: LGTM: Handle color now uses standardized text variable

The handle's background-color now uses --te-common-text-secondary, which is appropriate for this interactive element.


113-113: LGTM: Range background uses standardized variable

The range background-color properly uses the new --te-common-bg-container variable.


98-113: Verify consistent usage of new theme variables

Let's ensure these new theme variables are consistently used across other components and are properly defined in the theme system.

✅ Verification successful

Theme variables are properly defined and consistently used

The verification shows that:

  • The new te-common variables (bg-container and text-secondary) are properly defined in the theme system under packages/theme/base/src/common.less for both light and dark themes
  • These variables are widely and consistently used across multiple components
  • The variables are part of a systematic theme migration, as evidenced by their usage in mapping legacy ti-lowcode variables
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining ti-lowcode variables that should be migrated
rg --type=less --type=vue "var\(--ti-lowcode-" 

# Verify the new te-common variables are defined in theme files
rg --type=less "te-common-(bg-container|text-secondary|bg-popup)"

Length of output: 7687

packages/settings/styles/src/components/background/RadialGradient.vue (2)

137-137: LGTM: Theme variable update aligns with standardization effort

The change from --ti-lowcode-common-text-color-2 to --te-common-text-secondary aligns with the PR objective of standardizing theme variables.


137-137: Verify theme variable usage across the codebase

Let's ensure all related theme variables have been updated consistently across the codebase.

packages/plugins/datasource/src/DataSourceRecordList.vue (2)

618-618: LGTM: Theme variable standardization

The change from a specific variable to the common text primary color variable aligns with the PR objectives of standardizing theme variables.


636-636: LGTM: Theme variable standardization

The change to use the standardized datasource JSON border color variable is consistent with the theme standardization effort.

packages/settings/design/src/components/SettingPanel.vue (3)

260-260: LGTM: Appropriate variable transition for label text color

The change from ti-lowcode to te-common variable aligns with the PR objectives of standardizing theme variables.


266-266: LGTM: Semantic color usage for headers

Using --te-common-text-primary for headers establishes proper visual hierarchy.


385-385: LGTM: Consistent hover state styling

The use of --te-common-bg-primary-checked for hover states aligns with the theme system.

packages/settings/styles/src/components/typography/TypographyMore.vue (3)

Line range hint 75-124: LGTM! Script implementation follows Vue 3 best practices

The component setup is well-structured with proper prop definitions and reactive state management.


126-126: Theme variable updates look good but need completion

The changes to use --te-common-* variables align with the PR objectives for theme standardization.

Also applies to: 193-194, 231-231


Line range hint 147-147: Complete the theme variable migration

There are still several instances of ti-lowcode variables that should be migrated to the new te-common variables for consistency:

  • --ti-lowcode-toolbar-icon-color
  • --ti-lowcode-tabs-border-color

Consider updating these remaining instances to use the corresponding te-common variables:

- color: var(--ti-lowcode-toolbar-icon-color);
+ color: var(--te-common-text-primary);

- border: 1px solid var(--ti-lowcode-tabs-border-color);
+ border: 1px solid var(--te-common-border-color);

Let's verify the new variable usage across the codebase:

Also applies to: 176-176, 189-189, 211-211

packages/settings/design/src/components/PropertyCanvas.vue (2)

180-180: LGTM: Appropriate use of common text color variable

The change to --te-common-text-weaken aligns with the standardization effort and correctly represents the semantic meaning for empty state text.


262-267: LGTM: Consistent use of common theme variables

The color variables for the collapse header section have been properly standardized using semantic common variables for both text and background colors.

packages/settings/styles/src/components/inputs/ModalMask.vue (2)

95-95: LGTM! Color variable change aligns with standardization goals.

The change from var(--ti-lowcode-toolbar-breadcrumb-color) to var(--te-common-text-secondary) correctly follows the PR's objective of standardizing theme variables.


Line range hint 19-34: Consider handling left edge case in modal positioning

The setPosition function handles cases where the modal would overflow on the right side but doesn't handle cases where x < modalHalfWidth, which could cause the modal to overflow on the left side of the screen.

Consider updating the positioning logic:

   const setPosition = (event) => {
     const panelWidth = window.getComputedStyle(document.body).getPropertyValue('--base-right-panel-width')
     const innnerWidth = window.innerWidth
     const modalHalfWidth = (parseInt(panelWidth) - 24) / 2
     const x = event.x
     const y = event.y
     modal.top = y
+    // Ensure modal stays within viewport on both left and right edges
+    if (x < modalHalfWidth) {
+      modal.left = 0
     if (x + modalHalfWidth > innnerWidth) {
       modal.left = innnerWidth - (parseInt(panelWidth) - 24)
     } else if (x - modalHalfWidth < innnerWidth - parseInt(panelWidth)) {
       modal.left = innnerWidth - parseInt(panelWidth)
     } else {
       modal.left = x - modalHalfWidth
     }
   }
packages/settings/design/src/App.vue (2)

187-187: LGTM! Variable change aligns with new design system.

The change from --ti-button-info-normal-bg-color to --te-common-color-info correctly follows the PR objective of standardizing theme variables.


Line range hint 152-157: Verify theme variable usage across components.

Let's verify that these theme variables are consistently used across other components in the codebase.

Also applies to: 187-187

✅ Verification successful

Based on the search results, I can see that there is a transition happening in the codebase from ti-lowcode-common-* variables to te-common-* variables. The search shows:

  1. Extensive usage of ti-lowcode-common-* variables across multiple theme files and components
  2. Growing adoption of te-common-* variables, particularly in newer or updated components
  3. Both sets of variables coexist in the codebase, suggesting an ongoing migration

Let me verify if there are any migration guides or documentation about this theme transition.


Based on the comprehensive search results, I can provide a definitive response about the theme variable usage:

Theme variable migration is in progress, with both old and new systems coexisting.

The codebase shows a clear transition from ti-lowcode-common-* to te-common-* variables:

  1. The old ti-lowcode-common-* variables are still widely used across multiple components and theme files
  2. The new te-common-* variables are being adopted in newer components and theme files
  3. Both systems are properly defined in theme files:
    • Old: packages/theme/light/variable.less and packages/theme/dark/variable.less
    • New: packages/theme/base/src/common.less

This coexistence is intentional during the migration period, and the variables are being used consistently within their respective scopes. No issues were found with the current theme variable usage.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining ti-lowcode variable usage
echo "Checking for remaining ti-lowcode variables:"
rg --type=vue --type=less "ti-lowcode-common-" 

echo "\nChecking for new te-common variable adoption:"
rg --type=vue --type=less "te-common-" 

Length of output: 345


Script:

#!/bin/bash
# Search for any remaining ti-lowcode variable usage with correct file extensions
echo "Checking for remaining ti-lowcode variables:"
rg "ti-lowcode-common-" --type-add 'vue:*.vue' --type-add 'less:*.less' --type=vue --type=less

echo -e "\nChecking for new te-common variable adoption:"
rg "te-common-" --type-add 'vue:*.vue' --type-add 'less:*.less' --type=vue --type=less

Length of output: 65872


Script:

#!/bin/bash
# Search for any documentation about theme migration
echo "Checking for theme migration documentation:"
rg -i "theme.*(migration|transition|upgrade)" --type=md

echo -e "\nChecking README files for theme information:"
fd -e md -e mdx "README|CHANGELOG" -x cat {}

Length of output: 23854

packages/theme/dark/datasource.less (1)

22-22: Review tabs background color assignment

Using --te-common-text-primary for background color (--ti-lowcode-datasource-tabs-bg) seems incorrect. Text colors typically have different opacity and color values than background colors.

Please verify if this should be using a background-specific variable instead, such as --te-common-bg-container.

packages/theme/dark/settings.less (1)

35-40: LGTM! Good use of semantic variables

The root variables are well-structured with appropriate use of semantic color variables. The spacing colors are correctly differentiated between light and dark themes.

packages/theme/light/settings.less (1)

1-40: Verify consistent variable usage across themes

The light theme variables mirror the dark theme structure well, with appropriate color value differences. However, to ensure complete consistency:

  1. Verify that all variables defined in one theme exist in the other
  2. Ensure semantic meaning is preserved across themes
✅ Verification successful

Theme variables are consistently defined with appropriate color mappings

The verification shows perfect symmetry between light and dark themes. The only differences are the expected color value mappings for spacing variables:

  • Dark theme uses gray-130/140 for padding/margin
  • Light theme uses gray-10/30 for padding/margin

These differences are intentional and semantically correct for maintaining proper contrast in each theme mode.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Compare variable definitions between light and dark themes

# Extract variable names from both files
dark_vars=$(grep -o -- '--[^:]*' packages/theme/dark/settings.less | sort)
light_vars=$(grep -o -- '--[^:]*' packages/theme/light/settings.less | sort)

# Compare variables
echo "Variables only in dark theme:"
comm -23 <(echo "$dark_vars") <(echo "$light_vars")
echo -e "\nVariables only in light theme:"
comm -13 <(echo "$dark_vars") <(echo "$light_vars")

Length of output: 13229


Script:

#!/bin/bash
# Let's try a different approach using diff to compare the variables
# First, extract clean variable names without trailing characters

# Extract variables from dark theme
grep -o -- '--[^:]*:' packages/theme/dark/settings.less | sed 's/://g' | sort > dark_vars.txt

# Extract variables from light theme
grep -o -- '--[^:]*:' packages/theme/light/settings.less | sed 's/://g' | sort > light_vars.txt

# Compare the files
echo "=== Variables only in dark theme ==="
diff dark_vars.txt light_vars.txt | grep "^<" | cut -c 3-

echo -e "\n=== Variables only in light theme ==="
diff dark_vars.txt light_vars.txt | grep "^>" | cut -c 3-

# Cleanup
rm dark_vars.txt light_vars.txt

Length of output: 484


Script:

#!/bin/bash
# Let's try one more approach using direct string comparison of variable definitions

# Get both files content and compare
echo "=== Comparing variable definitions ==="
echo "Dark theme unique variables:"
grep -h "^[[:space:]]*--" packages/theme/dark/settings.less | sort > dark_vars.txt
grep -h "^[[:space:]]*--" packages/theme/light/settings.less | sort > light_vars.txt

# Show unique lines in each file
echo "=== Only in dark theme ==="
grep -Fxvf light_vars.txt dark_vars.txt

echo -e "\n=== Only in light theme ==="
grep -Fxvf dark_vars.txt light_vars.txt

# Cleanup
rm dark_vars.txt light_vars.txt

Length of output: 792

packages/theme/dark/datasource.less Outdated Show resolved Hide resolved
packages/theme/light/datasource.less Outdated Show resolved Hide resolved
packages/theme/light/datasource.less Outdated Show resolved Hide resolved
packages/theme/dark/settings.less Outdated Show resolved Hide resolved
packages/theme/dark/settings.less Show resolved Hide resolved
@chilingling chilingling merged commit e1806b3 into opentiny:refactor/develop Dec 13, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor-main refactor/develop branch feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants