Draftail.scss 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. $draftail-editor-text: $color-text-input;
  2. $draftail-editor-chrome: $color-white;
  3. $draftail-editor-chrome-text: $color-grey-2;
  4. $draftail-editor-chrome-active: $color-grey-2;
  5. $draftail-editor-chrome-accent: transparent;
  6. $draftail-editor-border: 0;
  7. $draftail-editor-padding: 0.75rem;
  8. $draftail-editor-background: transparent;
  9. $draftail-toolbar-radius: 3px;
  10. $draftail-toolbar-icon-size: 1em;
  11. $draftail-editor-font-family: $font-sans;
  12. @import '../../../../node_modules/draft-js/dist/Draft';
  13. @import '../../../../node_modules/draftail/lib/index';
  14. @import './Tooltip/Tooltip';
  15. @import './CommentableEditor/CommentableEditor';
  16. @import './EditorFallback/EditorFallback';
  17. @import './decorators/TooltipEntity';
  18. @import './blocks/MediaBlock';
  19. @import './blocks/ImageBlock';
  20. @import './blocks/EmbedBlock';
  21. @include draftail-richtext-styles {
  22. h1,
  23. h2,
  24. h3,
  25. h4,
  26. h5,
  27. h6 {
  28. // Overrides for other parts of the Wagtail admin.
  29. font-family: inherit;
  30. clear: both;
  31. line-height: 1;
  32. }
  33. h1,
  34. h2,
  35. h3 {
  36. line-height: 1.1;
  37. }
  38. h1 {
  39. font-size: 2em;
  40. }
  41. h2 {
  42. font-size: 1.8em;
  43. }
  44. h3 {
  45. font-size: 1.5em;
  46. }
  47. h4 {
  48. font-size: 1.2em;
  49. }
  50. h5 {
  51. font-size: 1.1em;
  52. }
  53. }
  54. .Draftail-Editor {
  55. border-radius: 0;
  56. &__wrapper {
  57. // Ensure elements within the editor are positioned according to this container.
  58. position: relative;
  59. }
  60. }
  61. .Draftail-ToolbarButton .icon {
  62. width: $draftail-toolbar-icon-size;
  63. height: $draftail-toolbar-icon-size;
  64. vertical-align: middle;
  65. }
  66. // When in a .full container, the editor has a specific appearance
  67. // so the whole area appears like a focusable area, and the editor
  68. // receives focus on click.
  69. .full .Draftail-Editor {
  70. padding-top: 2em;
  71. padding-bottom: 2em;
  72. background-color: $color-fieldset-hover;
  73. border-inline-end: 1px solid $color-input-border;
  74. &--focus {
  75. background-color: $color-input-focus;
  76. border-color: $color-input-focus-border;
  77. }
  78. }
  79. .full .Draftail-Editor .public-DraftEditor-content,
  80. .full .Draftail-Editor .public-DraftEditorPlaceholder-root {
  81. @include nice-padding;
  82. }
  83. .full .Draftail-Toolbar {
  84. @include nice-margin;
  85. }
  86. .Draftail-Toolbar {
  87. border: 1px solid $color-grey-3;
  88. }
  89. .Draftail-ToolbarButton {
  90. &:hover,
  91. &:active {
  92. border: 1px solid $color-grey-3;
  93. }
  94. }
  95. .title .Draftail-Editor .public-DraftEditor-content,
  96. .title .Draftail-Editor .public-DraftEditorPlaceholder-root {
  97. font-size: 2em;
  98. }
  99. .Draftail-block--blockquote {
  100. border-inline-start: 0.25em solid $color-grey-3;
  101. color: $color-grey-2;
  102. margin: 1em 0;
  103. padding: 1em 2em;
  104. }