-
-
Notifications
You must be signed in to change notification settings - Fork 394
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
fix(togglebutton component): fix togglebutton with long label in mobile #1199
Closed
nikitadubyk
wants to merge
4
commits into
themesberg:main
from
nikitadubyk:fix/broken-style-in-toggle-switch
Closed
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
47a47a4
fix(togglebutton component): fix togglebutton with long label in mobi…
8caa088
Merge branch 'main' into fix/broken-style-in-toggle-switch
nikitadubyk 3311292
Merge branch 'main' into fix/broken-style-in-toggle-switch
nikitadubyk e67ddac
fix: add min-width and rollback toggle width
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
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
|
@@ -10,7 +10,7 @@ export const toggleSwitchTheme: FlowbiteToggleSwitchTheme = { | |
label: 'ml-3 text-sm font-medium text-gray-900 dark:text-gray-300', | ||
}, | ||
toggle: { | ||
base: 'toggle-bg rounded-full border group-focus:ring-4 group-focus:ring-cyan-500/25', | ||
base: 'relative shrink-0 toggle-bg rounded-full border group-focus:ring-4 group-focus:ring-cyan-500/25', | ||
checked: { | ||
on: 'after:translate-x-full after:border-white', | ||
off: 'border-gray-200 bg-gray-200 dark:border-gray-600 dark:bg-gray-700', | ||
|
@@ -35,9 +35,9 @@ export const toggleSwitchTheme: FlowbiteToggleSwitchTheme = { | |
}, | ||
}, | ||
sizes: { | ||
sm: 'w-9 h-5 after:absolute after:top-[2px] after:left-[2px] after:h-4 after:w-4', | ||
md: 'w-11 h-6 after:absolute after:top-[2px] after:left-[2px] after:h-5 after:w-5', | ||
lg: 'w-14 h-7 after:absolute after:top-0.5 after:left-[4px] after:h-6 after:w-6', | ||
sm: 'w-9 h-5 after:absolute after:top-[1px] after:left-[2px] after:h-4 after:w-4', | ||
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. modifying the offset values makes the toggle switch look off 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. we also need |
||
md: 'w-11 h-6 after:absolute after:top-[1px] after:left-[2px] after:h-5 after:w-5', | ||
lg: 'w-14 h-7 after:absolute after:top-[1px] after:left-[4px] after:h-6 after:w-6', | ||
}, | ||
}, | ||
}; |
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.
adding just a
relative
is enoughThere 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.
without flex-shrink it will be broken (even with
![image](https://private-user-images.githubusercontent.com/73419198/326273462-44b28f48-424e-49e9-8848-61a7e93b62ff.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAyNDYwMDMsIm5iZiI6MTcyMDI0NTcwMywicGF0aCI6Ii83MzQxOTE5OC8zMjYyNzM0NjItNDRiMjhmNDgtNDI0ZS00OWU5LTg4NDgtNjFhN2U5M2I2MmZmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA2VDA2MDE0M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTlmOTQ3YWJlM2ZkYmVhNjk5MWNiNmRkYzdiNzc2NTFlNTA5Mzg5NzI2ZTJiNDI4MDdlNDNmNjhhMTk0MjU2OGUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.mduk7dTgzJg3l7Nmj6k3PjngMAvhN0IUpLjoES6DKXE)
min-width
values)