-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16766 from ckeditor/ck/16311-core-2
Feature (ui): Introduced nested menu component for dropdowns. Closes #6399.
- Loading branch information
Showing
50 changed files
with
3,452 additions
and
84 deletions.
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
83 changes: 83 additions & 0 deletions
83
...s/ckeditor5-theme-lark/theme/ckeditor5-ui/components/dropdown/menu/dropdownmenubutton.css
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 |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/* | ||
* Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved. | ||
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license | ||
*/ | ||
|
||
@import "../../../../mixins/_disabled.css"; | ||
@import "../../../mixins/_button.css"; | ||
@import "@ckeditor/ckeditor5-ui/theme/mixins/_dir.css"; | ||
|
||
/* | ||
* All menu buttons. | ||
*/ | ||
.ck.ck-dropdown-menu-list__nested-menu__button { | ||
width: 100%; | ||
padding: var(--ck-list-button-padding); | ||
border-radius: 0; | ||
|
||
&:focus { | ||
border-color: transparent; | ||
box-shadow: none; | ||
|
||
&:not(.ck-on) { | ||
background: var(--ck-color-button-default-hover-background); | ||
} | ||
} | ||
|
||
& > .ck-button__label { | ||
flex-grow: 1; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
} | ||
|
||
&.ck-disabled > .ck-button__label { | ||
@mixin ck-disabled; | ||
} | ||
|
||
/* Spacing in buttons that miss the icon. */ | ||
&.ck-icon-spacing:not(:has(.ck-button__icon)) > .ck-button__label { | ||
margin-left: calc(var(--ck-icon-size) - var(--ck-spacing-small)); | ||
} | ||
|
||
& > .ck-dropdown-menu-list__nested-menu__button__arrow { | ||
width: var(--ck-dropdown-arrow-size); | ||
|
||
@mixin ck-dir ltr { | ||
transform: rotate(-90deg); | ||
} | ||
|
||
@mixin ck-dir rtl { | ||
transform: rotate(90deg); | ||
} | ||
} | ||
|
||
&.ck-disabled > .ck-dropdown-menu-list__nested-menu__button__arrow { | ||
@mixin ck-disabled; | ||
} | ||
|
||
@mixin ck-dir ltr { | ||
&:not(.ck-button_with-text) { | ||
padding-left: var(--ck-spacing-small); | ||
} | ||
|
||
& > .ck-dropdown-menu-list__nested-menu__button__arrow { | ||
right: var(--ck-spacing-standard); | ||
|
||
/* A space to accommodate the triangle. */ | ||
margin-left: var(--ck-spacing-standard); | ||
} | ||
} | ||
|
||
@mixin ck-dir rtl { | ||
&:not(.ck-button_with-text) { | ||
padding-right: var(--ck-spacing-small); | ||
} | ||
|
||
& > .ck-dropdown-menu-list__nested-menu__button__arrow { | ||
left: var(--ck-spacing-standard); | ||
|
||
/* A space to accommodate the triangle. */ | ||
margin-right: var(--ck-spacing-small); | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...ckeditor5-theme-lark/theme/ckeditor5-ui/components/dropdown/menu/dropdownmenulistitem.css
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* | ||
* Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved. | ||
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license | ||
*/ | ||
|
||
:root { | ||
--ck-dropdown-menu-menu-item-min-width: 18em; | ||
} | ||
|
||
.ck.ck-dropdown-menu-list__nested-menu__item { | ||
min-width: var(--ck-dropdown-menu-menu-item-min-width); | ||
} |
36 changes: 36 additions & 0 deletions
36
...or5-theme-lark/theme/ckeditor5-ui/components/dropdown/menu/dropdownmenulistitembutton.css
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved. | ||
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license | ||
*/ | ||
|
||
/* | ||
* List item buttons. | ||
*/ | ||
.ck-button.ck-dropdown-menu-list__nested-menu__item__button { | ||
border-radius: 0; | ||
|
||
& > .ck-spinner-container, | ||
& > .ck-spinner-container .ck-spinner { | ||
/* These styles correspond to .ck-icon so that the spinner seamlessly replaces the icon. */ | ||
--ck-toolbar-spinner-size: 20px; | ||
} | ||
|
||
& > .ck-spinner-container { | ||
/* These margins are the same as for .ck-icon. */ | ||
margin-left: calc(-1 * var(--ck-spacing-small)); | ||
margin-right: var(--ck-spacing-small); | ||
} | ||
|
||
/* | ||
* Hovered items automatically get focused. Default focus styles look odd | ||
* while moving across a huge list of items so let's get rid of them | ||
*/ | ||
&:focus { | ||
border-color: transparent; | ||
box-shadow: none; | ||
|
||
&:not(.ck-on) { | ||
background: var(--ck-color-button-default-hover-background); | ||
} | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
...es/ckeditor5-theme-lark/theme/ckeditor5-ui/components/dropdown/menu/dropdownmenupanel.css
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved. | ||
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license | ||
*/ | ||
|
||
@import "../../../../mixins/_rounded.css"; | ||
@import "../../../../mixins/_shadow.css"; | ||
|
||
:root { | ||
--ck-dropdown-menu-menu-panel-max-width: 75vw; | ||
} | ||
|
||
.ck.ck-dropdown-menu__nested-menu__panel { | ||
@mixin ck-drop-shadow; | ||
|
||
background: var(--ck-color-dropdown-panel-background); | ||
border: 1px solid var(--ck-color-dropdown-panel-border); | ||
bottom: 0; | ||
height: fit-content; | ||
max-width: var(--ck-dropdown-menu-menu-panel-max-width); | ||
|
||
/* Reset balloon styling */ | ||
&::after, | ||
&::before { | ||
display: none; | ||
} | ||
|
||
/* Corner border radius consistent with the button. */ | ||
&.ck-balloon-panel_es, | ||
&.ck-balloon-panel_se { | ||
border-top-left-radius: 0; | ||
} | ||
|
||
&.ck-balloon-panel_ws, | ||
&.ck-balloon-panel_sw { | ||
border-top-right-radius: 0; | ||
} | ||
|
||
&.ck-balloon-panel_en, | ||
&.ck-balloon-panel_ne { | ||
border-bottom-left-radius: 0; | ||
} | ||
|
||
&.ck-balloon-panel_wn, | ||
&.ck-balloon-panel_nw { | ||
border-bottom-right-radius: 0; | ||
} | ||
|
||
&:focus { | ||
outline: none; | ||
} | ||
} |
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
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
Oops, something went wrong.