-
Notifications
You must be signed in to change notification settings - Fork 1
[IS-10713] draft implementation for language selector feature for SSP #63
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,7 +8,7 @@ | |
| z-index: 2; | ||
| width: max-content; | ||
| white-space: nowrap; | ||
| width: 100% | ||
| width: 100%; | ||
| } | ||
|
|
||
| @media (width >=64em) { | ||
|
|
@@ -26,3 +26,60 @@ | |
| .header svg { | ||
| flex-shrink: 0; | ||
| } | ||
|
|
||
| /* | ||
| TODO: this should be moved to @curity/ui-kit-css | ||
| to be used by UserMenu and the new language selector component | ||
| */ | ||
| .user-menu { | ||
|
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. @urre could we extract this into css lib and reuse it both for user menu and language selector components?
Collaborator
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. Yea. I don't think we should add all this CSS. We already have the We can generalize this in to a DropdownMenu component and reuse for both UserMenu and LanguageSelector
Collaborator
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. Or use |
||
| position: absolute; | ||
| right: var(--space-1); | ||
| height: min-content; | ||
| width: max-content; | ||
| border: 1px solid var(--color-grey-light); | ||
| background: white; | ||
|
|
||
| box-shadow: | ||
| 2.8px 2.8px 2.2px rgba(0, 0, 0, 0.02), | ||
| 6.7px 6.7px 5.3px rgba(0, 0, 0, 0.028), | ||
| 12.5px 12.5px 10px rgba(0, 0, 0, 0.035), | ||
| 22.3px 22.3px 17.9px rgba(0, 0, 0, 0.042), | ||
| 41.8px 41.8px 33.4px rgba(0, 0, 0, 0.05), | ||
| 100px 100px 80px rgba(0, 0, 0, 0.07); | ||
|
|
||
| z-index: 9999; | ||
| opacity: 0; | ||
| visibility: hidden; | ||
| transform: scale(0.9); | ||
| transform-origin: top right; | ||
| transition-property: transform, opacity, visibility; | ||
| transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); | ||
| transition-duration: 0.1s; | ||
|
|
||
| [role='menuitem'] { | ||
| border-radius: calc(var(--button-border-radius) - 1px); | ||
| } | ||
| } | ||
|
|
||
| .user-menu-open { | ||
| visibility: visible; | ||
| opacity: 1; | ||
| transform: scale(1); | ||
| } | ||
|
|
||
| .user-menu-chevron { | ||
| transition: transform 200ms ease-in-out; | ||
| transform-origin: center; | ||
| } | ||
|
|
||
| .user-menu-chevron-open { | ||
| transform: rotate(180deg); | ||
| } | ||
|
|
||
| .user-menu-username { | ||
| width: fit-content; | ||
| max-width: 80%; | ||
| overflow: hidden; | ||
| text-overflow: ellipsis; | ||
| white-space: nowrap; | ||
| } | ||
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.
@urre I suggest extracting this into its own
LanguageSelectorcomponentperhaps better to use
so, it is easier to extract the value of the selected option
WDYT?
Uh oh!
There was an error while loading. Please reload this page.
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's an option. Another option is to reuse
<UserMenu>and making that multi-purpose.But
<select>also works fine, simple and easy. We could also nest it inside the<UserMenu>See this example: