toolbar.css 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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 "@ckeditor/ckeditor5-ui/theme/mixins/_dir.css";
  7. .ck.ck-toolbar {
  8. @mixin ck-rounded-corners;
  9. background: var(--ck-color-toolbar-background);
  10. padding: 0 var(--ck-spacing-small);
  11. border: 1px solid var(--ck-color-toolbar-border);
  12. & > .ck-toolbar__items {
  13. & > * {
  14. /* Make sure items wrapped to the next line have v-spacing */
  15. margin-top: var(--ck-spacing-small);
  16. margin-bottom: var(--ck-spacing-small);
  17. /* (#11) Separate toolbar items. */
  18. margin-right: var(--ck-spacing-small);
  19. }
  20. }
  21. &.ck-toolbar_vertical {
  22. /* Items in a vertical toolbar span the entire width. */
  23. padding: 0;
  24. /* Specificity matters here. See https://github.com/ckeditor/ckeditor5-theme-lark/issues/168. */
  25. & > .ck-toolbar__items > .ck {
  26. /* Items in a vertical toolbar should span the horizontal space. */
  27. width: 100%;
  28. /* Items in a vertical toolbar should have no margin. */
  29. margin: 0;
  30. /* Items in a vertical toolbar span the entire width so rounded corners are pointless. */
  31. border-radius: 0;
  32. /* Items in a vertical toolbar span the entire width so any border is pointless. */
  33. border: 0;
  34. }
  35. }
  36. &.ck-toolbar_compact {
  37. /* No spacing around items. */
  38. padding: 0;
  39. & .ck-toolbar__items > .ck {
  40. /* No spacing between items. */
  41. margin: 0;
  42. /* No rounded corners on the right side of the first child. */
  43. &:first-child {
  44. border-top-right-radius: 0;
  45. border-bottom-right-radius: 0;
  46. }
  47. /* No rounded corners on the left side of the last child. */
  48. &:last-child {
  49. border-top-left-radius: 0;
  50. border-bottom-left-radius: 0;
  51. }
  52. /* "Middle" children should have no rounded corners. */
  53. &:not(:first-child):not(:last-child) {
  54. border-radius: 0;
  55. }
  56. }
  57. }
  58. & > .ck-toolbar__items > *,
  59. & > .ck.ck-toolbar__grouped-dropdown {
  60. /* Make sure items wrapped to the next line have v-spacing */
  61. margin-top: var(--ck-spacing-small);
  62. margin-bottom: var(--ck-spacing-small);
  63. }
  64. & > .ck.ck-toolbar__grouped-dropdown {
  65. /*
  66. * Dropdown button has asymmetric padding to fit the arrow.
  67. * This button has no arrow so let's revert that padding back to normal.
  68. */
  69. & > .ck.ck-button.ck-dropdown__button {
  70. padding-left: var(--ck-spacing-tiny);
  71. }
  72. }
  73. & .ck.ck-toolbar__separator {
  74. align-self: stretch;
  75. width: 1px;
  76. min-width: 1px;
  77. margin-top: 0;
  78. margin-bottom: 0;
  79. background: var(--ck-color-toolbar-border);
  80. }
  81. @nest .ck-toolbar-container & {
  82. border: 0;
  83. }
  84. }
  85. /*
  86. * Note: In some cases (e.g. a decoupled editor), the toolbar has its own "dir"
  87. * because its parent is not controlled by the editor framework.
  88. */
  89. [dir="rtl"] .ck.ck-toolbar,
  90. .ck.ck-toolbar[dir="rtl"] {
  91. & > .ck.ck-toolbar__grouped-dropdown {
  92. padding-right: var(--ck-spacing-small);
  93. }
  94. & > .ck.ck-toolbar__items {
  95. & > * {
  96. /* (#11) Separate toolbar items. */
  97. margin-left: var(--ck-spacing-small);
  98. margin-right: 0;
  99. }
  100. & > *:last-child {
  101. margin-left: 0;
  102. }
  103. }
  104. /* Some spacing between the items and the separator before the grouped items dropdown. */
  105. &.ck-toolbar_grouping > .ck-toolbar__items {
  106. margin-left: var(--ck-spacing-small);
  107. }
  108. }
  109. /*
  110. * Note: In some cases (e.g. a decoupled editor), the toolbar has its own "dir"
  111. * because its parent is not controlled by the editor framework.
  112. */
  113. [dir="ltr"] .ck.ck-toolbar,
  114. .ck.ck-toolbar[dir="ltr"] {
  115. & > .ck.ck-toolbar__grouped-dropdown {
  116. padding-left: var(--ck-spacing-small);
  117. }
  118. & > .ck.ck-toolbar__items {
  119. & > *:last-child {
  120. margin-right: 0;
  121. }
  122. }
  123. /* Some spacing between the items and the separator before the grouped items dropdown. */
  124. &.ck-toolbar_grouping > .ck-toolbar__items {
  125. margin-right: var(--ck-spacing-small);
  126. }
  127. }