8
0

button.css 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. /* Normalize the height of the line. Removing this will break consistent height
  22. among text and text-less buttons (with icons). */
  23. line-height: 1;
  24. /* Enable font size inheritance, which allows fluid UI scaling. */
  25. font-size: inherit;
  26. &:focus {
  27. @mixin ck-focus-ring;
  28. @mixin ck-box-shadow var(--ck-focus-outer-shadow);
  29. }
  30. /* https://github.com/ckeditor/ckeditor5-theme-lark/issues/70 */
  31. &.ck-disabled {
  32. & .ck-button__icon {
  33. @mixin ck-disabled;
  34. }
  35. /* https://github.com/ckeditor/ckeditor5-theme-lark/issues/98 */
  36. & .ck-button__label {
  37. @mixin ck-disabled;
  38. }
  39. }
  40. &.ck-button_with-text {
  41. padding: var(--ck-spacing-tiny) var(--ck-spacing-standard);
  42. & .ck-button__icon {
  43. margin-left: calc(-1 * var(--ck-spacing-small));
  44. margin-right: var(--ck-spacing-small);
  45. }
  46. }
  47. /* A style of the button which is currently on, e.g. its feature is active. */
  48. &.ck-on {
  49. @mixin ck-button-colors --ck-color-button-on;
  50. }
  51. & .ck-button__icon {
  52. & use,
  53. & use * {
  54. color: inherit;
  55. }
  56. }
  57. &:not(.ck-button_with-text) .ck-button__icon {
  58. /* This margin is neccessary for icons in label-less buttons to stretch
  59. the button properly. When there's no text in the button, browsers render
  60. them too small. It's a really tricky topic, when browsers render svg as an inline
  61. content and line size (character width) measurement and alignment kicks in. */
  62. margin: var(--ck-spacing-tiny);
  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. }