button.css 2.6 KB

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