button.css 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. border-width: 1px;
  15. border-style: solid;
  16. white-space: nowrap;
  17. cursor: default;
  18. vertical-align: middle;
  19. padding: var(--ck-spacing-tiny);
  20. text-align: center;
  21. /* A very important piece of styling. Go to variable declaration to learn more. */
  22. min-width: var(--ck-ui-component-min-height);
  23. min-height: var(--ck-ui-component-min-height);
  24. /* Normalize the height of the line. Removing this will break consistent height
  25. among text and text-less buttons (with icons). */
  26. line-height: 1;
  27. /* Enable font size inheritance, which allows fluid UI scaling. */
  28. font-size: inherit;
  29. &:focus {
  30. @mixin ck-focus-ring;
  31. @mixin ck-box-shadow var(--ck-focus-outer-shadow);
  32. }
  33. /* https://github.com/ckeditor/ckeditor5-theme-lark/issues/70 */
  34. &.ck-disabled {
  35. & .ck-button__icon {
  36. @mixin ck-disabled;
  37. }
  38. /* https://github.com/ckeditor/ckeditor5-theme-lark/issues/98 */
  39. & .ck-button__label {
  40. @mixin ck-disabled;
  41. }
  42. }
  43. &.ck-button_with-text {
  44. padding: var(--ck-spacing-tiny) var(--ck-spacing-standard);
  45. & .ck-button__icon {
  46. margin-left: calc(-1 * var(--ck-spacing-small));
  47. margin-right: var(--ck-spacing-small);
  48. }
  49. }
  50. /* A style of the button which is currently on, e.g. its feature is active. */
  51. &.ck-on {
  52. @mixin ck-button-colors --ck-color-button-on;
  53. }
  54. & .ck-button__icon {
  55. & use,
  56. & use * {
  57. color: inherit;
  58. }
  59. }
  60. & .ck-button__label {
  61. /* Enable font size inheritance, which allows fluid UI scaling. */
  62. font-size: inherit;
  63. font-weight: inherit;
  64. color: inherit;
  65. cursor: inherit;
  66. /* Must be consistent with .ck-icon's vertical align. Otherwise, buttons with and
  67. without labels (but with icons) have different sizes in Chrome */
  68. vertical-align: middle;
  69. }
  70. }
  71. /* A style of the button which handles the primary action. */
  72. .ck-button-action,
  73. a.ck-button-action {
  74. @mixin ck-button-colors --ck-color-button-action;
  75. color: var(--ck-color-button-action-text);
  76. }
  77. .ck-button-bold,
  78. a.ck-button-bold {
  79. font-weight: bold;
  80. }