-
Notifications
You must be signed in to change notification settings - Fork 330
feat(radio): [radio] Adapting to the SMB theme #1982
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
Conversation
WalkthroughThe changes primarily involve modifications to the Changes
Poem
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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 as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (1)
packages/theme/src/radio-button/index.less (1)
Line range hint
133-153: Correct border-radius variable usage.The border-radius is incorrectly set to
--ti-radio-button-margin-right. This appears to be a mistake.Apply this diff to correct the variable usage:
- border-radius: var(--ti-radio-button-margin-right); + border-radius: var(--ti-radio-button-border-radius);
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (10)
- examples/sites/demos/pc/app/radio/dynamic-disable-composition-api.vue (1 hunks)
- examples/sites/demos/pc/app/radio/dynamic-disable.vue (1 hunks)
- packages/theme/src/radio-button/index.less (7 hunks)
- packages/theme/src/radio-button/smb-theme.js (1 hunks)
- packages/theme/src/radio-button/vars.less (2 hunks)
- packages/theme/src/radio-group/index.less (3 hunks)
- packages/theme/src/radio-group/smb-theme.js (1 hunks)
- packages/theme/src/radio-group/vars.less (1 hunks)
- packages/theme/src/radio/smb-theme.js (1 hunks)
- packages/theme/src/theme.config.js (1 hunks)
Files skipped from review due to trivial changes (1)
- packages/theme/src/radio/smb-theme.js
Additional comments not posted (22)
packages/theme/src/radio-group/smb-theme.js (1)
12-19: Verify import statements for the new named export.The export type has changed from default to named export. Ensure that all import statements for this theme are updated accordingly.
Run the following script to verify the import statements:
packages/theme/src/radio-group/vars.less (1)
12-19: LGTM! The CSS variables align with the SMB theme.The new CSS class provides flexible styling options consistent with the SMB theme.
examples/sites/demos/pc/app/radio/dynamic-disable-composition-api.vue (1)
13-15: LGTM! The radio button is correctly disabled.The modification aligns with the intended functionality by disabling the "日度" option.
examples/sites/demos/pc/app/radio/dynamic-disable.vue (1)
13-15: Verify the impact of disabling radio buttons.Disabling the "日度" and "月度" radio buttons affects user interaction. Ensure that this change aligns with the intended design and user experience.
Run the following script to verify the usage of these radio buttons in the codebase:
packages/theme/src/radio-button/smb-theme.js (1)
17-34: LGTM! Verify CSS variable definitions.The changes improve maintainability by using CSS variables. Ensure that all CSS variables are defined and used consistently across the theme.
Run the following script to verify the definitions of the CSS variables used:
Verification successful
CSS Variable Definitions Verified
The CSS variables used in
packages/theme/src/radio-button/smb-theme.jsare defined inpackages/theme/src/base/basic-var.less. This ensures consistency and maintainability across the theme.
--ti-common-color-prompt-bg--ti-common-space-6--ti-common-color-text-weaken--ti-common-color-bg-dark-disabled--ti-common-color-bg-normal--ti-common-color-bg-disabled--ti-common-color-text-secondaryScripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the definitions of CSS variables. # Test: Search for the definitions of CSS variables. Expect: All variables are defined. rg --type css 'var\(--ti-common-color-prompt-bg\)|var\(--ti-common-space-2\)|var\(--ti-common-space-6\)|var\(--ti-common-color-text-weaken\)|var\(--ti-common-color-bg-dark-disabled\)|var\(--ti-common-color-bg-normal\)|var\(--ti-common-color-bg-disabled\)|var\(--ti-common-color-text-secondary\)'Length of output: 297
Script:
#!/bin/bash # Description: Verify the definitions of CSS variables across all file types. # Test: Search for the definitions of CSS variables across all file types. rg 'var\(--ti-common-color-prompt-bg\)|var\(--ti-common-space-2\)|var\(--ti-common-space-6\)|var\(--ti-common-color-text-weaken\)|var\(--ti-common-color-bg-dark-disabled\)|var\(--ti-common-color-bg-normal\)|var\(--ti-common-color-bg-disabled\)|var\(--ti-common-color-text-secondary\)'Length of output: 11408
Script:
#!/bin/bash # Description: Search specifically for the definitions of CSS variables. # Test: Search for the definitions of CSS variables in likely files. rg '--ti-common-color-prompt-bg:|--ti-common-space-2:|--ti-common-space-6:|--ti-common-color-text-weaken:|--ti-common-color-bg-dark-disabled:|--ti-common-color-bg-normal:|--ti-common-color-bg-disabled:|--ti-common-color-text-secondary:' --type css --type scss --type lessLength of output: 907
Script:
#!/bin/bash # Description: Search specifically for the definitions of CSS variables. # Test: Search for the definitions of CSS variables in likely files. rg -e 'ti-common-color-prompt-bg:' -e 'ti-common-space-2:' -e 'ti-common-space-6:' -e 'ti-common-color-text-weaken:' -e 'ti-common-color-bg-dark-disabled:' -e 'ti-common-color-bg-normal:' -e 'ti-common-color-bg-disabled:' -e 'ti-common-color-text-secondary:' --type css --type scss --type lessLength of output: 308
Script:
#!/bin/bash # Description: Search specifically for the definitions of CSS variables. # Test: Search for the definitions of CSS variables in CSS and LESS files. rg -e 'ti-common-color-prompt-bg:' -e 'ti-common-space-2:' -e 'ti-common-space-6:' -e 'ti-common-color-text-weaken:' -e 'ti-common-color-bg-dark-disabled:' -e 'ti-common-color-bg-normal:' -e 'ti-common-color-bg-disabled:' -e 'ti-common-color-text-secondary:' --type css --type lessLength of output: 1063
packages/theme/src/radio-group/index.less (1)
Line range hint
13-49: LGTM! Verify CSS variable definitions.The changes enhance modularity and consistency by using CSS variables. Ensure that all CSS variables are defined and used consistently across the styles.
Run the following script to verify the definitions of the CSS variables used:
Verification successful
All CSS Variables are Defined in LESS Files
The CSS variables used in the
radio-group/index.lessfile are all defined in the LESS files within the project. This ensures consistency and modularity across the styles.
- Definitions found in:
packages/theme/src/radio/vars.lesspackages/theme/src/radio-group/vars.lesspackages/theme/src/radio-button/vars.lessThe variables are properly defined, supporting the changes made for modularity and consistency.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the definitions of CSS variables. # Test: Search for the definitions of CSS variables. Expect: All variables are defined. rg --type less 'var\(--ti-radio-group-margin-bottom\)|var\(--ti-radio-button-margin-bottom\)|var\(--ti-radio-button-border-radius\)|var\(--ti-radio-button-top-border-radius\)|var\(--ti-radio-button-bottom-border-radius\)|var\(--ti-radio-button-border-top\)|var\(--ti-radio-button-border-color\)|var\(--ti-radio-button-checked-normal-border-color\)|var\(--ti-radio-input-checked-disabled-border-color\)'Length of output: 2528
Script:
#!/bin/bash # Description: Search for the definitions of CSS variables in LESS files. # Test: Search for the definitions of CSS variables. Expect: All variables are defined. rg --type less '--ti-radio-group-margin-bottom:|--ti-radio-button-margin-bottom:|--ti-radio-button-border-radius:|--ti-radio-button-top-border-radius:|--ti-radio-button-bottom-border-radius:|--ti-radio-button-border-top:|--ti-radio-button-border-color:|--ti-radio-button-checked-normal-border-color:|--ti-radio-input-checked-disabled-border-color:'Length of output: 1084
Script:
#!/bin/bash # Description: Search for the definitions of CSS variables in LESS files. # Test: Search for the definitions of CSS variables. Expect: All variables are defined. rg --type less -e '--ti-radio-group-margin-bottom:' -e '--ti-radio-button-margin-bottom:' -e '--ti-radio-button-border-radius:' -e '--ti-radio-button-top-border-radius:' -e '--ti-radio-button-bottom-border-radius:' -e '--ti-radio-button-border-top:' -e '--ti-radio-button-border-color:' -e '--ti-radio-button-checked-normal-border-color:' -e '--ti-radio-input-checked-disabled-border-color:'Length of output: 1512
packages/theme/src/radio-button/vars.less (8)
17-17: Ensure consistency with border-radius values.The border-radius has been set to
0, which aligns with a square design. Ensure this is consistent with the overall design guidelines for the SMB theme.
27-27: Clarify the purpose of--ti-radio-button-disabled-checked-text-color.The variable
--ti-radio-button-disabled-checked-text-coloris introduced with a weakened text color. Ensure this provides adequate contrast for accessibility.
30-30: Verify the use of--ti-radio-button-margin-right.The margin-right is set to
unset. Verify that this does not affect the layout negatively in the SMB theme.
31-31: Check the impact of--ti-radio-button-border-left.The border-left is set to
1px. Ensure this change aligns with the visual design requirements of the SMB theme.
32-33: Review border-radius values for child elements.The child elements have different border-radius values. Ensure these changes are consistent with the design specifications.
34-34: Assess the padding verticals adjustment.The padding verticals have been set using a common space variable. Verify that this provides the desired spacing across different screen sizes.
35-36: Evaluate active disabled color variables.The active disabled color variables have been introduced. Ensure these provide a clear visual indication of the disabled state.
37-37: Check the background color for checked disabled state.The checked disabled background color is set to
#bfbfbf. Verify that this color meets accessibility standards.packages/theme/src/theme.config.js (1)
89-90: Verify the removal ofcolor-select-panelandcolor-picker.The entries for
color-select-panelandcolor-pickerhave been replaced withradioandradio-group. Ensure that this change aligns with the overall theme strategy and does not affect other components relying on the old entries.packages/theme/src/radio-button/index.less (7)
21-21: Ensure border-radius consistency.The border-radius is set using a variable. Ensure this is consistent with the design guidelines for the SMB theme.
23-24: Review border and border-radius adjustments.The border-left and border-radius are set using variables. Verify that these changes maintain the intended visual hierarchy and design consistency.
32-32: Verify last-child border-radius settings.The border-radius for the last-child is set using variables. Ensure this aligns with the component's visual requirements.
44-44: Check margin-right impact.The margin-right is set using a variable. Verify that this change does not disrupt the layout or spacing.
52-54: Review padding and border-radius settings.Padding and border-radius are set using variables. Ensure these changes provide the desired spacing and visual appearance.
120-124: Evaluate disabled checked state styling.The background color and text color for the disabled checked state are set using variables. Ensure these provide adequate contrast and meet accessibility standards.
163-165: Assess active disabled state styling.The color and background color for the active disabled state are set using variables. Ensure these provide a clear visual distinction.
| --ti-radio-button-padding-verticals: var(--ti-common-space-3x); | ||
| --ti-radio-button-active-disabled-color: var(--ti-common-color-text-weaken); | ||
| --ti-radio-button-active-disabled-bg-color: var(--ti-common-color-bg-dark-disabled); | ||
| --ti-radio-button-checked-disabled-bg-color: #bfbfbf; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个颜色不应该写成死值
PR
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit
New Features
Style
Chores