toolbar.css 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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__items > *,
  37. & > .ck.ck-toolbar__grouped-dropdown {
  38. /* Make sure items wrapped to the next line have v-spacing */
  39. margin-top: var(--ck-spacing-small);
  40. margin-bottom: var(--ck-spacing-small);
  41. }
  42. & > .ck.ck-toolbar__grouped-dropdown {
  43. /*
  44. * Dropdown button has asymmetric padding to fit the arrow.
  45. * This button has no arrow so let's revert that padding back to normal.
  46. */
  47. & > .ck.ck-button.ck-dropdown__button {
  48. padding-left: var(--ck-spacing-tiny);
  49. }
  50. }
  51. & .ck.ck-toolbar__separator {
  52. align-self: stretch;
  53. width: 1px;
  54. min-width: 1px;
  55. margin-top: 0;
  56. margin-bottom: 0;
  57. background: var(--ck-color-toolbar-border);
  58. }
  59. @nest .ck-toolbar-container & {
  60. border: 0;
  61. }
  62. }
  63. /*
  64. * Note: In some cases (e.g. a decoupled editor), the toolbar has its own "dir"
  65. * because its parent is not controlled by the editor framework.
  66. */
  67. [dir="rtl"] .ck.ck-toolbar,
  68. .ck.ck-toolbar[dir="rtl"] {
  69. & > .ck.ck-toolbar__grouped-dropdown {
  70. padding-right: var(--ck-spacing-small);
  71. }
  72. & > .ck.ck-toolbar__items {
  73. & > * {
  74. /* (#11) Separate toolbar items. */
  75. margin-left: var(--ck-spacing-small);
  76. margin-right: 0;
  77. }
  78. & > *:last-child {
  79. margin-left: 0;
  80. }
  81. }
  82. /* Some spacing between the items and the separator before the grouped items dropdown. */
  83. &.ck-toolbar_grouping > .ck-toolbar__items {
  84. margin-left: var(--ck-spacing-small);
  85. }
  86. }
  87. /*
  88. * Note: In some cases (e.g. a decoupled editor), the toolbar has its own "dir"
  89. * because its parent is not controlled by the editor framework.
  90. */
  91. [dir="ltr"] .ck.ck-toolbar,
  92. .ck.ck-toolbar[dir="ltr"] {
  93. & > .ck.ck-toolbar__grouped-dropdown {
  94. padding-left: var(--ck-spacing-small);
  95. }
  96. & > .ck.ck-toolbar__items {
  97. & > *:last-child {
  98. margin-right: 0;
  99. }
  100. }
  101. /* Some spacing between the items and the separator before the grouped items dropdown. */
  102. &.ck-toolbar_grouping > .ck-toolbar__items {
  103. margin-right: var(--ck-spacing-small);
  104. }
  105. }