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

refactor(theme): [hrapprover] refactor hrapprover theme vars #2328

Merged
merged 2 commits into from
Oct 21, 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
28 changes: 14 additions & 14 deletions packages/theme/src/hrapprover/index.less
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
@input-prefix-cls: ~'@{css-prefix}input';

.@{hrapprover-prefix-cls} {
.component-css-vars-hrapprover();
.inject-Hrapprover-vars();

& &__list {
height: 180px;
Expand All @@ -26,21 +26,21 @@
}

& &__error {
border: solid 1px var(--ti-hrapprover-error-border-color);
border: solid 1px var(--tv-Hrapprover-error-border-color);
}

table {
tbody {
tr {
color: var(--ti-hrapprover-table-text-color);
background: var(--ti-hrapprover-tr-bg-color);
color: var(--tv-Hrapprover-table-text-color);
background: var(--tv-Hrapprover-tr-bg-color);

&:hover {
background: var(--ti-hrapprover-tr-hover-bg-color);
background: var(--tv-Hrapprover-tr-hover-bg-color);
}

&:nth-child(odd) {
background: var(--ti-hrapprover-tr-odd-bg-color);
background: var(--tv-Hrapprover-tr-odd-bg-color);
}
}
}
Expand All @@ -54,27 +54,27 @@
th {
border-left: none;
padding: 2px 0 2px 8px;
height: var(--ti-hrapprover-th-height);
height: var(--tv-Hrapprover-th-height);
}

td {
padding: 2px 0 2px 8px;
height: var(--ti-hrapprover-th-height);
font-size: var(--ti-hrapprover-table-font-size);
height: var(--tv-Hrapprover-th-height);
font-size: var(--tv-Hrapprover-table-font-size);
}

thead {
border-bottom: 1px solid var(--ti-hrapprover-thead-border-color);
border-bottom: 1px solid var(--tv-Hrapprover-thead-border-color);
text-align: left;
background: var(--ti-hrapprover-thead-bg-color);
color: var(--ti-hrapprover-table-text-color);
background: var(--tv-Hrapprover-thead-bg-color);
color: var(--tv-Hrapprover-table-text-color);

th {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: var(--ti-hrapprover-table-font-size);
color: var(--ti-hrapprover-table-text-color);
font-size: var(--tv-Hrapprover-table-font-size);
color: var(--tv-Hrapprover-table-text-color);
}
}
}
Expand Down
20 changes: 10 additions & 10 deletions packages/theme/src/hrapprover/vars.less
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
*
*/

.component-css-vars-hrapprover() {
--ti-hrapprover-error-border-color: var(--ti-base-color-bg-8, #c7000b);
--ti-hrapprover-table-text-color: var(--ti-common-color-info-normal, #191919);
--ti-hrapprover-table-font-size: var(--ti-common-font-size-base, 14px);
--ti-hrapprover-tr-bg-color: #fafafa;
--ti-hrapprover-tr-hover-bg-color: var(--ti-common-color-hover-background, #f5f5f5);
--ti-hrapprover-tr-odd-bg-color: var(--ti-common-color-light, #ffffff);
--ti-hrapprover-th-height: var(--ti-common-size-height-small, 24px);
--ti-hrapprover-thead-border-color: var(--ti-common-color-border, #999999);
--ti-hrapprover-thead-bg-color: #f1f1f1;
.inject-Hrapprover-vars() {
--tv-Hrapprover-error-border-color: var(--tv-color-error-bg);
--tv-Hrapprover-table-text-color: var(--tv-color-text);
--tv-Hrapprover-table-font-size: var(--tv-font-size-md);
--tv-Hrapprover-tr-bg-color: var(--tv-color-bg-gray-1);
--tv-Hrapprover-tr-hover-bg-color: var(--tv-color-bg-hover);
--tv-Hrapprover-tr-odd-bg-color: var(--tv-color-bg-secondary);
--tv-Hrapprover-th-height: var(--tv-size-height-xs);
--tv-Hrapprover-thead-border-color: var(--tv-color-border);
--tv-Hrapprover-thead-bg-color: var(--tv-color-bg-header);
Comment on lines +13 to +22
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

Old variable names still present in the codebase

Multiple instances of hrapprover are still found in the following files, indicating incomplete refactoring:

  • packages/vue/src/hrapprover/src/pc.vue
  • packages/theme/src/hrapprover/index.less
  • packages/theme-saas/src/hrapprover/index.less

Please update these references to ensure consistency and prevent potential issues.

🔗 Analysis chain

Verify broader impacts of the refactoring

While the changes are excellent, please consider and verify the following:

  1. Ensure all references to the old variable names (with --ti- prefix) have been updated throughout the codebase.
  2. Confirm that the new color and size references maintain the intended design of the Hrapprover component.
  3. Update any relevant documentation or usage examples to reflect the new variable names.

To help verify the changes, you can run the following script:

This script will help identify any remaining instances of the old variable names and potential areas that might need updating due to the refactoring.


[/run_scripts]

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining old variable names and find potential places that need updating

# Search for old variable names
echo "Searching for old --ti- prefixed variables:"
rg --type=less --type=vue '--ti-hrapprover' packages/

# Search for potential places that might need updating
echo "Searching for potential places that might need updating:"
rg --type=less --type=vue 'hrapprover' packages/

# Check for any documentation files that might need updating
echo "Checking for documentation files that might need updating:"
rg --type=md 'hrapprover' docs/

Length of output: 973


Script:

#!/bin/bash
# Description: Check for any remaining old variable names and find potential places that need updating

# Search for old variable names
echo "Searching for old --ti- prefixed variables:"
rg -g "*.less" -g "*.vue" '--ti-hrapprover' packages/

# Search for potential places that might need updating
echo "Searching for potential places that might need updating:"
rg -g "*.less" -g "*.vue" 'hrapprover' packages/

# Check for any documentation files that might need updating, if the docs directory exists
if [ -d "docs" ]; then
  echo "Checking for documentation files that might need updating:"
  rg -g "*.md" 'hrapprover' docs/
else
  echo "Documentation directory 'docs/' does not exist. Skipping documentation check."
fi

Length of output: 2476

}
Loading