8
0

button.css 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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. &: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. & .ck-button__icon {
  64. & use,
  65. & use * {
  66. color: inherit;
  67. }
  68. }
  69. & .ck-button__label {
  70. /* Enable font size inheritance, which allows fluid UI scaling. */
  71. font-size: inherit;
  72. font-weight: inherit;
  73. color: inherit;
  74. cursor: inherit;
  75. /* Must be consistent with .ck-icon's vertical align. Otherwise, buttons with and
  76. without labels (but with icons) have different sizes in Chrome */
  77. vertical-align: middle;
  78. }
  79. }
  80. /* A style of the button which handles the primary action. */
  81. .ck-button-action,
  82. a.ck-button-action {
  83. @mixin ck-button-colors --ck-color-button-action;
  84. color: var(--ck-color-button-action-text);
  85. }
  86. .ck-button-bold,
  87. a.ck-button-bold {
  88. font-weight: bold;
  89. }