-
Notifications
You must be signed in to change notification settings - Fork 337
fix(button,button-group): adapting the button component to small screens #4080
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
James-9696
wants to merge
7
commits into
dev
Choose a base branch
from
fix-btn-adp-style
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+98
−0
Open
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
e36bb7b
fix(button): adapt to small screen display
James-9696 cb1b674
fix(button-group): adapt to small screen display
James-9696 a256b0d
fix(button-group): add variables
James-9696 2847cb8
fix: to avoid conflicts
James-9696 0afbeed
fix: modify review comments
James-9696 e86fbf2
fix: modify default button of style
James-9696 934e38b
fix: modify review comments
James-9696 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| @import './button/adaptation.less'; | ||
| @import './button-group/adaptation.less'; | ||
| // @import './link/adaptation.less'; | ||
| // @import './action-menu/adaptation.less'; | ||
| // @import './breadcrumb/adaptation.less'; | ||
| // @import './breadcrumb-item/adaptation.less'; | ||
| // @import './dropdown/adaptation.less'; | ||
| // @import './dropdown-item/adaptation.less'; | ||
| // @import './pager/adaptation.less'; | ||
| // @import './steps/adaptation.less'; | ||
| // @import './steps-item/adaptation.less'; | ||
| // @import './tabs/adaptation.less'; | ||
| // @import './base-select/adaptation.less'; | ||
| // @import './cascader/adaptation.less'; | ||
| // @import './checkbox/adaptation.less'; | ||
| // @import './checkbox-group/adaptation.less'; | ||
| // @import './form/adaptation.less'; | ||
| // @import './form-item/adaptation.less'; | ||
| // @import './input/adaptation.less'; | ||
| // @import './numeric/adaptation.less'; | ||
| // @import './radio/adaptation.less'; | ||
| // @import './radio-group/adaptation.less'; | ||
| // @import './search/adaptation.less'; | ||
| // @import './select/adaptation.less'; | ||
| // @import './switch/adaptation.less'; | ||
| // @import './grid/adaptation.less'; | ||
| // @import './tag/adaptation.less'; | ||
| // @import './alert/adaptation.less'; | ||
| // @import './dialog-box/adaptation.less'; | ||
| // @import './drawer/adaptation.less'; | ||
| // @import './loading/adaptation.less'; | ||
| // @import './modal/adaptation.less'; | ||
| // @import './notify/adaptation.less'; | ||
| // @import './progress/adaptation.less'; | ||
| // @import './popover/adaptation.less'; | ||
| // @import './skeleton/adaptation.less'; | ||
| // @import './tooltip/adaptation.less'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| /* stylelint-disable function-no-unknown */ | ||
| @import '../mixins/common.less'; | ||
| @import '../mixins/button-group.less'; | ||
| @import '../custom.less'; | ||
| @import './vars.less'; | ||
|
|
||
| @button-group-prefix-cls: ~'@{css-prefix}button-group'; | ||
| @group-item-prefix-cls: ~'@{css-prefix}group-item'; | ||
| @button-group-popover-prefix-cls: ~'@{css-prefix}group-item__more-popover'; | ||
|
|
||
| .@{button-group-prefix-cls} { | ||
| .inject-ButtonGroup-vars(); | ||
|
|
||
| @media (max-width: 820px) { | ||
| .@{group-item-prefix-cls} { | ||
| & li { | ||
| button { | ||
| &.disabled, | ||
| &[disabled] { | ||
| color: var(--tv-ButtonGroup-item-btn-adapt-disabled-text-color); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| &__sup-icon { | ||
| background-color: var(--tv-ButtonGroup-item-adapt-icon-bg-color); | ||
| border-radius: 0 6px; | ||
| fill: #c25700; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 颜色值和圆角是不是都可以使用common变量呢?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 颜色值没有基础样式变量,圆角已替换common变量 |
||
| display: flex; | ||
| align-items: center; | ||
| justify-content: center; | ||
| } | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| /* stylelint-disable function-no-unknown */ | ||
| @import '../custom.less'; | ||
| @import './vars.less'; | ||
|
|
||
| @button-prefix-cls: ~'@{css-prefix}button'; | ||
| @svg-prefix-cls: ~'@{css-prefix}svg'; | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| .@{button-prefix-cls} { | ||
| .inject-Button-vars(); | ||
| @media (max-width: 820px) { | ||
| &.is-icon { | ||
| .tiny-svg { | ||
| fill: var(--tv-Button-icon-adapt-inverse-tint); | ||
| } | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🧩 Analysis chain
🏁 Script executed:
Repository: opentiny/tiny-vue
Length of output: 1240
🏁 Script executed:
Repository: opentiny/tiny-vue
Length of output: 1249
🏁 Script executed:
Repository: opentiny/tiny-vue
Length of output: 1327
🏁 Script executed:
Repository: opentiny/tiny-vue
Length of output: 556
🏁 Script executed:
Repository: opentiny/tiny-vue
Length of output: 460
🏁 Script executed:
Repository: opentiny/tiny-vue
Length of output: 2018
Add
customSyntaxoverride to packages/theme/.stylelintrc.json to properly parse LESS variable interpolation, or expand the stylelint-disable comment to includeCssSyntaxError.Both
button/adaptation.lessandbutton-group/adaptation.lessuse LESS variable-interpolation syntax (.@{button-group-prefix-cls}, etc.) but carry only/* stylelint-disable function-no-unknown */. The packages/theme/.stylelintrc.json extends stylelint-config-standard-scss without specifyingpostcss-lessas the custom syntax for.lessfiles, causing stylelint's CSS parser to throwCssSyntaxErroron the interpolation syntax. This suppression comment does not suppressCssSyntaxError. Either add"customSyntax": "postcss-less"to the overrides in packages/theme/.stylelintrc.json, or update the suppression comment to include/* stylelint-disable function-no-unknown, CssSyntaxError */.🧰 Tools
🪛 Stylelint (17.3.0)
[error] 11-11: Unknown word button-group-prefix-cls (CssSyntaxError)
(CssSyntaxError)
🤖 Prompt for AI Agents