button.css 2.6 KB

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