dropdown.css 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /*
  2. * Copyright (c) 2003-2020, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
  4. */
  5. @import "../../../mixins/_rounded.css";
  6. @import "../../../mixins/_disabled.css";
  7. @import "../../../mixins/_shadow.css";
  8. @import "@ckeditor/ckeditor5-ui/theme/mixins/_dir.css";
  9. :root {
  10. --ck-dropdown-arrow-size: calc(0.5 * var(--ck-icon-size));
  11. }
  12. .ck.ck-dropdown {
  13. /* Enable font size inheritance, which allows fluid UI scaling. */
  14. font-size: inherit;
  15. & .ck-dropdown__arrow {
  16. width: var(--ck-dropdown-arrow-size);
  17. }
  18. @mixin ck-dir ltr {
  19. & .ck-dropdown__arrow {
  20. right: var(--ck-spacing-standard);
  21. /* A space to accommodate the triangle. */
  22. margin-left: var(--ck-spacing-standard);
  23. }
  24. }
  25. @mixin ck-dir rtl {
  26. & .ck-dropdown__arrow {
  27. left: var(--ck-spacing-standard);
  28. /* A space to accommodate the triangle. */
  29. margin-right: var(--ck-spacing-small);
  30. }
  31. }
  32. &.ck-disabled .ck-dropdown__arrow {
  33. @mixin ck-disabled;
  34. }
  35. & .ck-button.ck-dropdown__button {
  36. @mixin ck-dir ltr {
  37. &:not(.ck-button_with-text) {
  38. /* Make sure dropdowns with just an icon have the right inner spacing */
  39. padding-left: var(--ck-spacing-small);
  40. }
  41. }
  42. @mixin ck-dir rtl {
  43. &:not(.ck-button_with-text) {
  44. /* Make sure dropdowns with just an icon have the right inner spacing */
  45. padding-right: var(--ck-spacing-small);
  46. }
  47. }
  48. /* #23 */
  49. & .ck-button__label {
  50. width: 7em;
  51. overflow: hidden;
  52. text-overflow: ellipsis;
  53. }
  54. /* https://github.com/ckeditor/ckeditor5-theme-lark/issues/70 */
  55. &.ck-disabled .ck-button__label {
  56. @mixin ck-disabled;
  57. }
  58. /* https://github.com/ckeditor/ckeditor5/issues/816 */
  59. &.ck-on {
  60. border-bottom-left-radius: 0;
  61. border-bottom-right-radius: 0;
  62. }
  63. &.ck-dropdown__button_label-width_auto .ck-button__label {
  64. width: auto;
  65. }
  66. }
  67. }
  68. .ck.ck-dropdown__panel {
  69. @mixin ck-rounded-corners;
  70. @mixin ck-drop-shadow;
  71. background: var(--ck-color-dropdown-panel-background);
  72. border: 1px solid var(--ck-color-dropdown-panel-border);
  73. bottom: 0;
  74. /* Make sure the panel is at least as wide as the drop-down's button. */
  75. min-width: 100%;
  76. /* Disabled corner border radius to be consistent with the .dropdown__button
  77. https://github.com/ckeditor/ckeditor5/issues/816 */
  78. &.ck-dropdown__panel_se {
  79. border-top-left-radius: 0;
  80. }
  81. &.ck-dropdown__panel_sw {
  82. border-top-right-radius: 0;
  83. }
  84. &.ck-dropdown__panel_ne {
  85. border-bottom-left-radius: 0;
  86. }
  87. &.ck-dropdown__panel_nw {
  88. border-bottom-right-radius: 0;
  89. }
  90. }