button.css 2.3 KB

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