-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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: button group #2473
feat: button group #2473
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2473 +/- ##
==========================================
- Coverage 78.93% 78.59% -0.35%
==========================================
Files 253 258 +5
Lines 7815 7908 +93
Branches 857 875 +18
==========================================
+ Hits 6169 6215 +46
- Misses 1382 1427 +45
- Partials 264 266 +2
|
b743873
to
df92134
Compare
DeepCode's analysis on #0d88ee found:
Top issues
👉 View analysis in DeepCode’s Dashboard | Configure the bot |
src/framework/theme/components/button-group/_button-group.component.theme.scss
Outdated
Show resolved
Hide resolved
fix: changed way button styles connect fix: removed unused imports and styles
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.
A few more comments:
- Use default sized button in examples (except for size example). Currently most example has
giant
buttons for some reason. button-group-multiple.component
example. Icon only buttons should be square shaped (see example here). Make sure button toggle also has same styles as button here.- Ensure button and button toggle has the same dimensions. You can add button toggles to the button interactive examples and compare it there. https://akveo.github.io/nebular/example/button/button-interactive.component. And also check button dimensions didn't changed in this PR (compare with online docs examples).
div { | ||
display: flex; | ||
align-items: center; | ||
} |
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.
There is no div
in the nb-button-group
template.
|
||
[nbButtonToggle], [nbButton] { | ||
&:focus { | ||
//Needs to make shadow visible |
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.
Let's clarify with something like:
Sibling buttons are covering outline shadow.
position: relative;
declaration makes shadow appear on top of sibling buttons.
border-radius, 0 nb-theme(button-#{$shape}-border-radius) nb-theme(button-#{$shape}-border-radius) 0); | ||
@include nb-rtl( | ||
border-radius, nb-theme(button-#{$shape}-border-radius) 0 0 nb-theme(button-#{$shape}-border-radius)); | ||
} | ||
|
||
&:first-child.shape-#{$shape} { | ||
@include nb-ltr( | ||
border-radius, nb-theme(button-#{$shape}-border-radius) 0 0 nb-theme(button-#{$shape}-border-radius)); | ||
@include nb-rtl( | ||
border-radius, 0 nb-theme(button-#{$shape}-border-radius) nb-theme(button-#{$shape}-border-radius) 0); |
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.
Assign nb-theme(button-#{$shape}-border-radius)
to a variable and use it to reduce lines length.
@include nb-ltr(border-right, | ||
nb-theme(button-toggle-border-width) | ||
nb-theme(button-toggle-border-style) | ||
nb-theme(button-toggle-border-color)); | ||
@include nb-rtl(border-left, | ||
nb-theme(button-toggle-border-width) | ||
nb-theme(button-toggle-border-style) | ||
nb-theme(button-toggle-border-color)); | ||
|
||
&:hover { | ||
@include nb-ltr(border-right, | ||
nb-theme(button-toggle-border-width) | ||
nb-theme(button-toggle-border-style) | ||
nb-theme(button-toggle-border-color)); | ||
@include nb-rtl(border-left, | ||
nb-theme(button-toggle-border-width) | ||
nb-theme(button-toggle-border-style) | ||
nb-theme(button-toggle-border-color)); |
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.
Let's introduce a variable and set it to border values so we don't need to repeat tree nb-theme
calls four times. Something like:
$border: nb-theme(button-toggle-border-width) nb-theme(button-toggle-border-style) nb-theme(button-toggle-border-color);
// ...
@include nb-ltr(border-right, $border);
src/framework/theme/components/button-group/button-group.component.ts
Outdated
Show resolved
Hide resolved
src/framework/theme/components/button-group/button-group.component.ts
Outdated
Show resolved
Hide resolved
Instead of setting border-radius, reset it only on unnecessary element sides. Correct border-radius already set in button and button toggle styles. We only need to reset it to 0 on the sides where the element has siblings.
Don't remove border as height of buttons inside the group would be smaller than buttons outside the group. Also, make divider on the start side as per design.
8dea161
to
0d88ee5
Compare
(cherry picked from commit 72bb1b3)
Please read and mark the following check list before creating a pull request:
Short description of what this resolves: