button.css 2.7 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. @import "@ckeditor/ckeditor5-ui/theme/components/button/mixins/_button.css";
  11. .ck-button,
  12. a.ck-button {
  13. @mixin ck-button-colors --ck-color-button-default;
  14. @mixin ck-rounded-corners;
  15. border-width: 1px;
  16. border-style: solid;
  17. white-space: nowrap;
  18. cursor: default;
  19. vertical-align: middle;
  20. padding: var(--ck-spacing-tiny);
  21. text-align: center;
  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. &:focus {
  28. @mixin ck-focus-ring;
  29. @mixin ck-box-shadow var(--ck-focus-outer-shadow);
  30. }
  31. /* https://github.com/ckeditor/ckeditor5-theme-lark/issues/70 */
  32. &.ck-disabled {
  33. @mixin ck-button-icon {
  34. @mixin ck-disabled;
  35. }
  36. /* https://github.com/ckeditor/ckeditor5-theme-lark/issues/98 */
  37. & .ck-button__label {
  38. @mixin ck-disabled;
  39. }
  40. }
  41. &.ck-button_with-text {
  42. padding: var(--ck-spacing-tiny) var(--ck-spacing-standard);
  43. @mixin ck-button-icon {
  44. margin-left: calc(-1 * var(--ck-spacing-small));
  45. margin-right: var(--ck-spacing-small);
  46. }
  47. }
  48. /* A style of the button which is currently on, e.g. its feature is active. */
  49. &.ck-on {
  50. @mixin ck-button-colors --ck-color-button-on;
  51. }
  52. @mixin ck-button-icon {
  53. use,
  54. use * {
  55. color: inherit;
  56. }
  57. }
  58. &:not(.ck-button_with-text) {
  59. @mixin ck-button-icon {
  60. /* This margin is neccessary for icons in label-less buttons to stretch
  61. the button properly. When there's no text in the button, browsers render
  62. them too small. It's a really tricky topic, when browsers render svg as an inline
  63. content and line size (character width) measurement and alignment kicks in. */
  64. margin: var(--ck-spacing-tiny);
  65. }
  66. }
  67. & .ck-button__label {
  68. /* Enable font size inheritance, which allows fluid UI scaling. */
  69. font-size: inherit;
  70. font-weight: inherit;
  71. color: inherit;
  72. cursor: inherit;
  73. /* Must be consistent with .ck-icon's vertical align. Otherwise, buttons with and
  74. without labels (but with icons) have different sizes in Chrome */
  75. vertical-align: middle;
  76. }
  77. }
  78. /* A style of the button which handles the primary action. */
  79. .ck-button-action,
  80. a.ck-button-action {
  81. @mixin ck-button-colors --ck-color-button-action;
  82. color: var(--ck-color-button-action-text);
  83. }
  84. .ck-button-bold,
  85. a.ck-button-bold {
  86. font-weight: bold;
  87. }