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: toggle follow fiori3 #492
Conversation
Deploy preview for fundamental-styles ready! Built with commit f43b06b |
src/form-label.scss
Outdated
@@ -84,5 +84,8 @@ $block: #{$fd-namespace}-form-label; | |||
overflow: initial; | |||
margin-top: 5px; | |||
margin-bottom: 5px; | |||
display: flex; |
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.
why is this needed?
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.
Since we are introducing Breaking changes for this component I think it's a good idea to also rename the classes from toggle
to switch
docs/pages/components/toggle.md
Outdated
|
||
{% capture default %} | ||
<div class="fd-form-group"> | ||
<div class="fd-form-item"> | ||
<label class="fd-form-label" for="y21YO391">Live:</label> | ||
<label class="fd-form-label">Toggle with label</label> | ||
<label class="fd-form-label fd-form-label--toggle"> |
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.
This will make the toggle component dependent on fd-form-label
. Can you create a new class and if you depend a lot on fd-form-label
maybe create a mixin and include it here.
docs/pages/components/toggle.md
Outdated
<input class="fd-toggle__input" type="checkbox" name="" value="" id="y21YO3911"> | ||
<div class="fd-toggle__wrapper"> | ||
<div class="fd-toggle__inner"> | ||
<span class="fd-toggle__label fd-toggle__label--on">on</span> |
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.
fd-switch__text
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.
I wanted to use fd-toggle__label
not only for text, it's also for icons.
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.
I will use __text
, because __label
is reserved for labels
docs/pages/components/toggle.md
Outdated
<div class="fd-toggle__wrapper"> | ||
<div class="fd-toggle__inner"> | ||
<span class="fd-toggle__label fd-toggle__label--on">on</span> | ||
<span class="fd-toggle__switch" role="presentation"></span> |
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.
fd-switch__handle
docs/pages/components/toggle.md
Outdated
<span class="fd-toggle__switch" role="presentation"></span> | ||
<input class="fd-toggle__input" type="checkbox" name="" value="" id="y21YO3911"> | ||
<div class="fd-toggle__wrapper"> | ||
<div class="fd-toggle__inner"> |
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.
fd-switch__track
src/toggle.scss
Outdated
background-color: $fd-toggle-inactive-switch-background; | ||
width: $fd-toggle-switch-size; | ||
height: $fd-toggle-switch-size; | ||
border-radius: $fd-toggle-switch-border-radius; |
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.
missing background-clip: padding-box;
src/toggle.scss
Outdated
$fd-toggle-container-padding-y: 0.375rem; | ||
$fd-toggle-size-x: 3.75rem; | ||
$fd-toggle-size-y: 1.25rem; | ||
$fd-toggle-switch-size: 1.875rem; |
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.
Isn't it 2rem?
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.
It is, but actually it's counted with (2* 0.0625rem) border, so it gives 2rem.
65e1b2f
to
f741c54
Compare
All of the comments are solved now. It's ready to second review. |
<span class="fd-toggle"> | ||
<input class="fd-toggle__input" type="checkbox" name="" value="" id="y21YO391"> | ||
<span class="fd-toggle__switch" role="presentation"></span> | ||
<label class="fd-form-label">Toggle with label</label> |
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.
shouldn't you only use the switch label?
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.
Labels are not stricly connected to switch
. So I don't think so
can we see a before and after screen shots on the PR description? |
@bcullman I noticed your comments too late, after merging this commit. But it has been tested and compared to fiori3 specs and everything works correct. |
@thanks @JKMarkowski looks great! Thats been wrong for a long time. Glad thats been fixed. I did note one other oddity on the alert - when in RTL mode, the close button is off by pixel from the edge. See vs rtl |
Related Issue
Closes #456
Closes #535
Description
There are is new toggle, which follows fiori3 specs
Breaking changes
fd-toggle__text
- To put some text (max 3 chars) inside toggle.fd-toggle__wrapper
,fd-toggle__track
.Screenshots
Before:
After: