button.css 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /*
  2. * Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
  3. * For licensing, see LICENSE.md.
  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. .ck.ck-button,
  11. a.ck.ck-button {
  12. @mixin ck-button-colors --ck-color-button-default;
  13. @mixin ck-rounded-corners;
  14. white-space: nowrap;
  15. cursor: default;
  16. vertical-align: middle;
  17. padding: var(--ck-spacing-tiny);
  18. text-align: center;
  19. /* A very important piece of styling. Go to variable declaration to learn more. */
  20. min-width: var(--ck-ui-component-min-height);
  21. min-height: var(--ck-ui-component-min-height);
  22. /* Normalize the height of the line. Removing this will break consistent height
  23. among text and text-less buttons (with icons). */
  24. line-height: 1;
  25. /* Enable font size inheritance, which allows fluid UI scaling. */
  26. font-size: inherit;
  27. /* Avoid flickering when the foucs border shows up. */
  28. border: 1px solid transparent;
  29. &:active,
  30. &:focus {
  31. @mixin ck-focus-ring;
  32. @mixin ck-box-shadow var(--ck-focus-outer-shadow);
  33. /* Disable border part of the focus ring for the buttons. It is too much. */
  34. border-color: transparent;
  35. }
  36. /* https://github.com/ckeditor/ckeditor5-theme-lark/issues/70 */
  37. &.ck-disabled {
  38. & .ck-button__icon {
  39. @mixin ck-disabled;
  40. }
  41. /* https://github.com/ckeditor/ckeditor5-theme-lark/issues/98 */
  42. & .ck-button__label {
  43. @mixin ck-disabled;
  44. }
  45. }
  46. &.ck-button_with-text {
  47. padding: var(--ck-spacing-tiny) var(--ck-spacing-standard);
  48. & .ck-button__icon {
  49. margin-left: calc(-1 * var(--ck-spacing-small));
  50. margin-right: var(--ck-spacing-small);
  51. }
  52. }
  53. /* A style of the button which is currently on, e.g. its feature is active. */
  54. &.ck-on {
  55. @mixin ck-button-colors --ck-color-button-on;
  56. }
  57. &.ck-button-save {
  58. color: var(--ck-color-button-save);
  59. }
  60. &.ck-button-cancel {
  61. color: var(--ck-color-button-cancel);
  62. }
  63. /* Allow icon coloring using the text "color" property. */
  64. & .ck-button__icon {
  65. & use,
  66. & use * {
  67. color: inherit;
  68. }
  69. }
  70. & .ck-button__label {
  71. /* Enable font size inheritance, which allows fluid UI scaling. */
  72. font-size: inherit;
  73. font-weight: inherit;
  74. color: inherit;
  75. cursor: inherit;
  76. /* Must be consistent with .ck-icon's vertical align. Otherwise, buttons with and
  77. without labels (but with icons) have different sizes in Chrome */
  78. vertical-align: middle;
  79. }
  80. }
  81. /* A style of the button which handles the primary action. */
  82. .ck.ck-button-action,
  83. a.ck.ck-button-action {
  84. @mixin ck-button-colors --ck-color-button-action;
  85. color: var(--ck-color-button-action-text);
  86. }
  87. .ck.ck-button-bold,
  88. a.ck.ck-button-bold {
  89. font-weight: bold;
  90. }