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(theme): change incorrect css variables and delete the ‘less’ file #1120

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion packages/layout/src/Main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export default {
#tiny-engine {
display: flex;
flex-flow: column;
min-width: var(--base-min-width);
min-width: var(--te-base-min-width);
height: 100vh;
overflow: hidden;
.tiny-engine-main {
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/tree/src/styles/vars.less
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
--te-tree-icon-color: var(--te-common-icon-secondary);
--te-tree-bg-color-active: var(--te-common-bg-container);
--te-tree-text-color: var(--te-common-text-primary);
--te-tree-block-text-color: var(--te-common-color-prompt-secondary);
--te-tree-block-text-color: var(--te-common-text-purple);
}
11 changes: 5 additions & 6 deletions packages/settings/design/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ export default {

<style lang="less">
:root {
--ti-lowcode-common-secondary-text-color: #adb0b8;
--ti-lowcode-common-hover-bg-color: #f2f5fc;
--ti-lowcode-mask-bg: #fafafa;
--te-setting-design-secondary-text-color: #adb0b8;
--te-setting-design-hover-bg-color: #f2f5fc;
--te-lowcode-mask-bg: #fafafa;
--max-height: calc(65vh - 70px);
}
html {
Expand Down Expand Up @@ -181,9 +181,8 @@ td {
}
.mask {
.source-code {
--ti-lowcode-toolbar-bg: var(--ti-lowcode-mask-bg);
.tiny-button {
--ti-button-info-normal-bg-color: #1476ff;
background-color: #1476ff;
}
}
}
Expand Down Expand Up @@ -212,7 +211,7 @@ td {
}

.canvas {
background: var(--ti-lowcode-common-hover-bg-color);
background: var(--te-setting-design-hover-bg-color);
padding: 20px;
margin: 0 20px;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ export default {
}
.tiny-form-item__content {
.editor-warp {
--ti-lowcode-meta-codeEditor-border-color: #595959;
--ti-lowcode-meta-codeEditor-color: #595959;
border-color: #595959;
color: #595959;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/settings/design/src/components/PropertyCanvas.vue
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ export default {
padding: 3px 10px;
cursor: pointer;
&.active {
background-color: var(--ti-lowcode-common-hover-bg-color);
background-color: var(--te-setting-design-hover-bg-color);
}
.item-input .action-icon {
display: none;
Expand Down
4 changes: 2 additions & 2 deletions packages/settings/design/src/components/PropertyList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export default {
}
.property-list-tips {
font-size: 12px;
color: var(--ti-lowcode-common-secondary-text-color);
color: var(--te-setting-design-secondary-text-color);
}
.help-icon {
margin-left: 3px;
Expand All @@ -116,7 +116,7 @@ export default {
border: 1px solid #e6e6e6;

&:hover {
background: var(--ti-lowcode-common-hover-bg-color);
background: var(--te-setting-design-hover-bg-color);
}
}
</style>
3 changes: 0 additions & 3 deletions packages/settings/design/src/components/SettingPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -369,9 +369,6 @@ export default {
flex-wrap: wrap;
width: 100%;
}
:deep(.tiny-switch) {
width: var(--ti-switch-width);
}
.setting-radio-group {
&.setting-layout {
width: 100%;
Expand Down
8 changes: 3 additions & 5 deletions packages/settings/styles/src/components/inputs/ModalMask.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,11 @@ export default {
box-sizing: border-box;
}
.modal-padding {
padding: var(--ti-modal-padding-y, 14px) var(--ti-modal-padding-x, 20px);
padding: 14px 20px;
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Avoid hardcoding style values.

The changes replace CSS variables with hardcoded values, which reduces maintainability and theme flexibility. Consider keeping these as CSS variables for better maintainability and theme support.

Apply this diff to restore CSS variables with standardized names:

-    padding: 14px 20px;
+    padding: var(--te-modal-padding-y, 14px) var(--te-modal-padding-x, 20px);

-    right: 280px;
-    left: calc(100% - 287px - 280px - 16px);
+    right: var(--te-modal-right-offset, 280px);
+    left: calc(
+      100% - var(--te-modal-right-offset, 287px) - var(--te-modal-right-offset, 280px) - var(--te-modal-spacing, 16px)
+    );

Also applies to: 113-114

}
.align-body {
right: var(--modal-right-offset, 280px);
left: calc(
100% - var(--modal-right-offset, 287px) - var(--modal-right-offset, 280px) - var(--modal-spaceing, 16px)
);
right: 280px;
left: calc(100% - 287px - 280px - 16px);
}
}
</style>
5 changes: 5 additions & 0 deletions packages/theme/base/src/base.less
Original file line number Diff line number Diff line change
Expand Up @@ -317,4 +317,9 @@
--te-base-border-radius-2: 6px; // 圆角-2
--te-base-border-radius-3: 8px; // 圆角-3
--te-base-border-radius-4: 50%; // 圆形

/**
* 基础配置
**/
--te-base-min-width: 1280px;
}
19 changes: 0 additions & 19 deletions packages/theme/dark/block.less

This file was deleted.

6 changes: 0 additions & 6 deletions packages/theme/dark/bridge.less

This file was deleted.

27 changes: 0 additions & 27 deletions packages/theme/dark/canvas.less

This file was deleted.

39 changes: 0 additions & 39 deletions packages/theme/dark/datasource.less

This file was deleted.

30 changes: 0 additions & 30 deletions packages/theme/dark/events.less

This file was deleted.

67 changes: 0 additions & 67 deletions packages/theme/dark/gpt-dialog.less

This file was deleted.

12 changes: 0 additions & 12 deletions packages/theme/dark/help.less

This file was deleted.

8 changes: 0 additions & 8 deletions packages/theme/dark/i18n.less

This file was deleted.

19 changes: 0 additions & 19 deletions packages/theme/dark/index.less
Original file line number Diff line number Diff line change
@@ -1,20 +1 @@
// 主题配置优先于公共配置
@import './variable.less';
@import './block.less';
@import './life-cycles.less';
@import './tutorial.less';
@import './help.less';
@import './settings.less';
@import './metaComponent.less';
@import './events.less';
@import './i18n.less';
@import './pageManage.less';
@import './materials.less';
@import './tree.less';
@import './canvas.less';
@import './bridge.less';
@import './toolbar.less';
@import './datasource.less';
@import './plugin-js.less';
@import './gpt-dialog.less';
@import './setting-style';
7 changes: 0 additions & 7 deletions packages/theme/dark/life-cycles.less

This file was deleted.

24 changes: 0 additions & 24 deletions packages/theme/dark/materials.less

This file was deleted.

Loading
Loading