8
0

button.css 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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/_focus.css";
  6. @import "../../../mixins/_shadow.css";
  7. @import "../../../mixins/_disabled.css";
  8. @import "../../../mixins/_rounded.css";
  9. @import "../../mixins/_button.css";
  10. @import "@ckeditor/ckeditor5-ui/theme/mixins/_dir.css";
  11. .ck.ck-button,
  12. a.ck.ck-button {
  13. @mixin ck-button-colors --ck-color-button-default;
  14. @mixin ck-rounded-corners;
  15. white-space: nowrap;
  16. cursor: default;
  17. vertical-align: middle;
  18. padding: var(--ck-spacing-tiny);
  19. text-align: center;
  20. /* A very important piece of styling. Go to variable declaration to learn more. */
  21. min-width: var(--ck-ui-component-min-height);
  22. min-height: var(--ck-ui-component-min-height);
  23. /* Normalize the height of the line. Removing this will break consistent height
  24. among text and text-less buttons (with icons). */
  25. line-height: 1;
  26. /* Enable font size inheritance, which allows fluid UI scaling. */
  27. font-size: inherit;
  28. /* Avoid flickering when the foucs border shows up. */
  29. border: 1px solid transparent;
  30. /* Apply some smooth transition to the box-shadow. */
  31. transition: box-shadow 200ms ease-in-out;
  32. /* https://github.com/ckeditor/ckeditor5-theme-lark/issues/189 */
  33. -webkit-appearance: none;
  34. &:active,
  35. &:focus {
  36. @mixin ck-focus-ring;
  37. @mixin ck-box-shadow var(--ck-focus-outer-shadow);
  38. /* Disable border part of the focus ring for the buttons. It is too much. */
  39. border-color: transparent;
  40. }
  41. /* https://github.com/ckeditor/ckeditor5-theme-lark/issues/70 */
  42. &.ck-disabled {
  43. &:active,
  44. &:focus {
  45. /* The disabled button should have a slightly less visible shadow when focused. */
  46. @mixin ck-box-shadow var(--ck-focus-disabled-outer-shadow);
  47. }
  48. & .ck-button__icon {
  49. @mixin ck-disabled;
  50. }
  51. /* https://github.com/ckeditor/ckeditor5-theme-lark/issues/98 */
  52. & .ck-button__label {
  53. @mixin ck-disabled;
  54. }
  55. }
  56. &.ck-button_with-text {
  57. padding: var(--ck-spacing-tiny) var(--ck-spacing-standard);
  58. & .ck-button__icon {
  59. @mixin ck-dir ltr {
  60. margin-left: calc(-1 * var(--ck-spacing-small));
  61. margin-right: var(--ck-spacing-small);
  62. }
  63. @mixin ck-dir rtl {
  64. margin-right: calc(-1 * var(--ck-spacing-small));
  65. margin-left: var(--ck-spacing-small);
  66. }
  67. }
  68. }
  69. /* A style of the button which is currently on, e.g. its feature is active. */
  70. &.ck-on {
  71. @mixin ck-button-colors --ck-color-button-on;
  72. }
  73. &.ck-button-save {
  74. color: var(--ck-color-button-save);
  75. }
  76. &.ck-button-cancel {
  77. color: var(--ck-color-button-cancel);
  78. }
  79. /* Allow icon coloring using the text "color" property. */
  80. & .ck-button__icon {
  81. & use,
  82. & use * {
  83. color: inherit;
  84. }
  85. }
  86. & .ck-button__label {
  87. /* Enable font size inheritance, which allows fluid UI scaling. */
  88. font-size: inherit;
  89. font-weight: inherit;
  90. color: inherit;
  91. cursor: inherit;
  92. /* Must be consistent with .ck-icon's vertical align. Otherwise, buttons with and
  93. without labels (but with icons) have different sizes in Chrome */
  94. vertical-align: middle;
  95. @mixin ck-dir ltr {
  96. text-align: left;
  97. }
  98. @mixin ck-dir rtl {
  99. text-align: right;
  100. }
  101. }
  102. }
  103. /* A style of the button which handles the primary action. */
  104. .ck.ck-button-action,
  105. a.ck.ck-button-action {
  106. @mixin ck-button-colors --ck-color-button-action;
  107. color: var(--ck-color-button-action-text);
  108. }
  109. .ck.ck-button-bold,
  110. a.ck.ck-button-bold {
  111. font-weight: bold;
  112. }