Draftail.scss 2.6 KB

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