button.css 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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. /* Apply some smooth transition to the box-shadow. */
  30. transition: box-shadow 200ms ease-in-out;
  31. &:active,
  32. &:focus {
  33. @mixin ck-focus-ring;
  34. @mixin ck-box-shadow var(--ck-focus-outer-shadow);
  35. /* Disable border part of the focus ring for the buttons. It is too much. */
  36. border-color: transparent;
  37. }
  38. /* https://github.com/ckeditor/ckeditor5-theme-lark/issues/70 */
  39. &.ck-disabled {
  40. &:active,
  41. &:focus {
  42. /* The disabled button should have a slightly less visible shadow when focused. */
  43. @mixin ck-box-shadow var(--ck-focus-disabled-outer-shadow);
  44. }
  45. & .ck-button__icon {
  46. @mixin ck-disabled;
  47. }
  48. /* https://github.com/ckeditor/ckeditor5-theme-lark/issues/98 */
  49. & .ck-button__label {
  50. @mixin ck-disabled;
  51. }
  52. }
  53. &.ck-button_with-text {
  54. padding: var(--ck-spacing-tiny) var(--ck-spacing-standard);
  55. & .ck-button__icon {
  56. margin-left: calc(-1 * var(--ck-spacing-small));
  57. margin-right: var(--ck-spacing-small);
  58. }
  59. }
  60. /* A style of the button which is currently on, e.g. its feature is active. */
  61. &.ck-on {
  62. @mixin ck-button-colors --ck-color-button-on;
  63. }
  64. &.ck-button-save {
  65. color: var(--ck-color-button-save);
  66. }
  67. &.ck-button-cancel {
  68. color: var(--ck-color-button-cancel);
  69. }
  70. /* Allow icon coloring using the text "color" property. */
  71. & .ck-button__icon {
  72. & use,
  73. & use * {
  74. color: inherit;
  75. }
  76. }
  77. & .ck-button__label {
  78. /* Enable font size inheritance, which allows fluid UI scaling. */
  79. font-size: inherit;
  80. font-weight: inherit;
  81. color: inherit;
  82. cursor: inherit;
  83. /* Must be consistent with .ck-icon's vertical align. Otherwise, buttons with and
  84. without labels (but with icons) have different sizes in Chrome */
  85. vertical-align: middle;
  86. }
  87. }
  88. /* A style of the button which handles the primary action. */
  89. .ck.ck-button-action,
  90. a.ck.ck-button-action {
  91. @mixin ck-button-colors --ck-color-button-action;
  92. color: var(--ck-color-button-action-text);
  93. }
  94. .ck.ck-button-bold,
  95. a.ck.ck-button-bold {
  96. font-weight: bold;
  97. }