Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(color-select-panel): [color-select-panel]modify smb-theme #1837

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

Merged
merged 2 commits into from
Aug 8, 2024

Conversation

James-9696
Copy link
Collaborator

@James-9696 James-9696 commented Aug 6, 2024

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)

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:

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

  • New Features

    • Introduced a cohesive theme configuration for the color select panel and color picker, enhancing customization options.
    • Added new CSS variables and properties for improved styling capabilities.
  • Improvements

    • Streamlined the layout and dimensions of the color select panel components for better usability.
    • Updated the HTML structure for improved semantic clarity and performance within the color select panel.
  • Bug Fixes

    • Corrected styling inconsistencies by unifying variable names and dimensions across the color select panel.

Copy link

coderabbitai bot commented Aug 6, 2024

Walkthrough

The changes enhance the color select panel's usability and aesthetics, implementing a more compact design and streamlined styles. Key updates include style modifications in LESS files, the introduction of new CSS variables for better customization, and improvements to the Vue component structure. These adjustments not only refine visual elements but also support a cohesive theming approach across the application, adding new features and simplifying the configuration.

Changes

File Path Change Summary
.../color-select-panel/index.less Adjusted dimensions and colors for improved layout; reduced max width and sizes of inner components; refined collapse item styles.
.../color-select-panel/smb-theme.js Added theme configuration object defining various style properties for the color select panel.
.../color-select-panel/vars.less Renamed background color variable; introduced multiple new CSS variables for enhanced styling capabilities.
.../theme.config.js Added new entries for 'color-select-panel', 'color-picker', and 'skeleton'; removed the 'split' property from the exported configuration object.
.../infinity-theme/component-vars.js Added new margin property for buttons in the color select panel while maintaining existing properties.
.../vars.less Introduced new imports for color-picker and color-select-panel styles; corrected syntax in an existing import statement.
.../color-select-panel/src/pc.vue Updated template structure by modifying component attributes and enhancing conditional rendering for history and predefined color sections.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant ColorSelectPanel
    participant Button
    participant Input

    User->>ColorSelectPanel: Open color select panel
    ColorSelectPanel->>Input: Render input fields
    ColorSelectPanel->>Button: Render buttons with size="small"
    User->>Button: Click a color option
    Button->>ColorSelectPanel: Update selected color
    ColorSelectPanel->>User: Display selected color
Loading

🐰 In the meadow, colors bloom,
With designs that chase away the gloom.
Buttons small and panels bright,
Hopping with joy, a pure delight!
Each change a spark, a playful gleam,
Together, we create a vibrant dream! 🌈✨


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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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.

Copy link

github-actions bot commented Aug 6, 2024

[e2e-test-warn]
The component to be tested is missing.

The title of the Pull request should look like "fix(vue-renderless): [action-menu, alert] fix xxx bug".

Please make sure you've read our contributing guide

Copy link

@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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between c2593f7 and 6637fbe.

Files selected for processing (7)
  • packages/theme/src/color-select-panel/index.less (5 hunks)
  • packages/theme/src/color-select-panel/smb-theme.js (1 hunks)
  • packages/theme/src/color-select-panel/vars.less (1 hunks)
  • packages/theme/src/theme.config.js (1 hunks)
  • packages/theme/src/theme/infinity-theme/component-vars.js (1 hunks)
  • packages/theme/src/vars.less (1 hunks)
  • packages/vue/src/color-select-panel/src/pc.vue (1 hunks)
Additional comments not posted (39)
packages/theme/src/color-select-panel/smb-theme.js (6)

2-2: LGTM!

The variable ti-color-select-panel-border-radius-xs is correctly defined and uses a common border radius variable.


3-3: LGTM!

The variable ti-color-select-panel-border-radius-sm is correctly defined and uses a common border radius variable.


4-4: LGTM!

The variable ti-color-select-panel-tools-line-height is correctly defined and uses a common size height variable.


5-5: LGTM!

The variable ti-color-select-panel-btn-margin is correctly defined and uses a fixed margin value.


6-6: LGTM!

The variable ti-color-select-panel-collapse-color is correctly defined and uses a common color variable.


7-7: LGTM!

The variable ti-color-select-panel-btn-border-hover-color is correctly defined and uses a common color variable.

packages/theme/src/color-select-panel/vars.less (6)

27-27: LGTM!

The variable --ti-color-select-panel-bg-color is correctly defined and uses a common color variable.


29-29: LGTM!

The variable --ti-color-select-panel-btn-border-color is correctly defined and uses a common color variable.


31-31: LGTM!

The variable --ti-color-select-panel-btn-border-hover-color is correctly defined and uses a common color variable.


33-33: LGTM!

The variable --ti-color-select-panel-tools-line-height is correctly defined and uses a common size height variable.


35-35: LGTM!

The variable --ti-color-select-panel-btn-margin is correctly defined and uses a fixed margin value.


37-37: LGTM!

The variable --ti-color-select-panel-collapse-color is correctly defined and uses a common color variable.

packages/theme/src/vars.less (3)

69-69: LGTM!

The import statement for skeleton-item/vars.less has been correctly modified to include a semicolon, aligning with standard syntax practices.


70-70: LGTM!

The import statement for color-picker/vars.less is correctly defined.


71-71: LGTM!

The import statement for color-select-panel/vars.less is correctly defined.

packages/theme/src/theme.config.js (1)

86-87: Entries added correctly.

The new entries 'color-select-panel' and 'color-picker' follow the existing pattern and are correctly added to the export.

packages/vue/src/color-select-panel/src/pc.vue (8)

6-6: Adding size="small" to tiny-input

The addition of size="small" to tiny-input improves the visual presentation by making the input field more compact.


8-11: Adding size="small" to tiny-button

The addition of size="small" to tiny-button improves the visual presentation by making the buttons more compact.


18-18: Refining conditional rendering for history section

The use of a div for conditional rendering based on state.stack.length enhances the semantic structure of the HTML.


21-22: Adding key to v-for directive

Including the key in the v-for directive improves performance and ensures correct rendering of list items.


29-29: Refining conditional rendering for empty history section

The use of a div for conditional rendering when state.stack.length is zero enhances the semantic structure of the HTML.


36-36: Refining conditional rendering for predefined color section

The use of a div for conditional rendering based on state.predefineStack.length enhances the semantic structure of the HTML.


39-40: Adding key to v-for directive

Including the key in the v-for directive improves performance and ensures correct rendering of list items.


47-47: Refining conditional rendering for empty predefined color section

The use of a div for conditional rendering when state.predefineStack.length is zero enhances the semantic structure of the HTML.

packages/theme/src/color-select-panel/index.less (13)

10-10: Reducing max-width to 264px

The reduction of the max-width from 300px to 264px makes the panel more compact and visually appealing.


12-12: Simplifying background color variable

The simplification of the background color variable to --ti-color-select-panel-bg-color improves readability and maintainability.


19-19: Adding line-height to tools section

The addition of line-height to the tools section improves the layout consistency.


25-25: Adding margin to button group

The addition of margin to the button group improves the spacing and layout consistency.


27-33: Styling tiny-button

The added styles for tiny-button enhance the visual presentation and interactivity of the buttons.


41-42: Adjusting dimensions of color select area

The adjustments to the width and height of the color select area make it more compact and visually appealing.


72-72: Adjusting width of hue select

The reduction of the width of the hue select makes the component more compact and visually appealing.


90-91: Adjusting dimensions of alpha slider

The adjustments to the width and height of the alpha slider make it more compact and visually appealing.


97-97: Adding border-radius to alpha slider

The addition of border-radius to the alpha slider enhances the visual presentation.


112-113: Removing border from collapse

The removal of the border from the collapse component creates a cleaner interface.


115-124: Styling collapse item header

The added styles for the collapse item header enhance the visual presentation and interactivity.


Line range hint 126-142:
Styling collapse item content

The added styles for the collapse item content enhance the visual presentation and layout consistency.


146-151: Styling collapse item wrap and arrow

The added styles for the collapse item wrap and the removal of the arrow create a cleaner interface.

packages/theme/src/theme/infinity-theme/component-vars.js (2)

381-381: Addition of new property for button margins.

The new property 'ti-color-select-panel-btn-margin': '8px' enhances customization options for button margins in the color select panel.


380-380: Addition of trailing comma for consistency.

The trailing comma added after the last property maintains consistency and simplifies future additions.

@kagol kagol added the enhancement New feature or request (功能增强) label Aug 6, 2024
@James-9696 James-9696 changed the title fix(color-select-panel): modify smb-theme fix(color-select-panel): [color-select-panel]modify smb-theme Aug 6, 2024
@James-9696 James-9696 changed the title fix(color-select-panel): [color-select-panel]modify smb-theme feat(color-select-panel): [color-select-panel]modify smb-theme Aug 6, 2024
zzcr
zzcr previously approved these changes Aug 7, 2024
@James-9696 James-9696 changed the title feat(color-select-panel): [color-select-panel]modify smb-theme wip:feat(color-select-panel): [color-select-panel]modify smb-theme Aug 7, 2024
Copy link

@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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 6637fbe and 801104d.

Files selected for processing (1)
  • packages/theme/src/theme.config.js (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • packages/theme/src/theme.config.js

@James-9696 James-9696 force-pushed the fix-xdesign-color-select branch 2 times, most recently from f788099 to 6637fbe Compare August 7, 2024 02:28
@James-9696 James-9696 changed the title wip:feat(color-select-panel): [color-select-panel]modify smb-theme feat(color-select-panel): [color-select-panel]modify smb-theme Aug 7, 2024
@zzcr zzcr merged commit 3c2e262 into opentiny:dev Aug 8, 2024
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request (功能增强)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants