dropdown.css 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*
  2. * Copyright (c) 2003-2019, 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-small);
  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. /* https://github.com/ckeditor/ckeditor5-theme-lark/issues/70 */
  49. &.ck-disabled .ck-button__label {
  50. @mixin ck-disabled;
  51. }
  52. /* https://github.com/ckeditor/ckeditor5/issues/816 */
  53. &.ck-on {
  54. border-bottom-left-radius: 0;
  55. border-bottom-right-radius: 0;
  56. }
  57. /* #23 */
  58. & .ck-button__label {
  59. width: 7em;
  60. overflow: hidden;
  61. text-overflow: ellipsis;
  62. }
  63. }
  64. }
  65. .ck.ck-dropdown__panel {
  66. @mixin ck-rounded-corners;
  67. @mixin ck-drop-shadow;
  68. /* Disabled radius of top-left border to be consistent with .dropdown__button
  69. https://github.com/ckeditor/ckeditor5/issues/816 */
  70. @mixin ck-rounded-corners {
  71. border-top-left-radius: 0;
  72. }
  73. background: var(--ck-color-dropdown-panel-background);
  74. border: 1px solid var(--ck-color-dropdown-panel-border);
  75. bottom: 0;
  76. /* Make sure the panel is at least as wide as the drop-down's button. */
  77. min-width: 100%;
  78. }