base.styl 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. // Styles shared between snow and bubble
  2. controlHeight = 24px
  3. inputPaddingWidth = 5px
  4. inputPaddingHeight = 3px
  5. colorItemMargin = 2px
  6. colorItemSize = 16px
  7. colorItemsPerRow = 7
  8. .ql-{themeName}.ql-toolbar, .ql-{themeName} .ql-toolbar
  9. &:after
  10. clear: both
  11. content: ''
  12. display: table
  13. button
  14. background: none
  15. border: none
  16. cursor: pointer
  17. display: inline-block
  18. float: left
  19. height: controlHeight
  20. padding: inputPaddingHeight inputPaddingWidth
  21. width: controlHeight + (inputPaddingWidth - inputPaddingHeight)*2
  22. svg
  23. float: left
  24. height: 100%
  25. &:active:hover
  26. outline: none
  27. input.ql-image[type=file]
  28. display: none
  29. button:hover, button:focus, button.ql-active,
  30. .ql-picker-label:hover, .ql-picker-label.ql-active,
  31. .ql-picker-item:hover, .ql-picker-item.ql-selected
  32. color: activeColor
  33. .ql-fill, .ql-stroke.ql-fill
  34. fill: activeColor
  35. .ql-stroke, .ql-stroke-miter
  36. stroke: activeColor
  37. // Fix for iOS not losing hover on touch
  38. @media (pointer: coarse)
  39. .ql-{themeName}.ql-toolbar, .ql-{themeName} .ql-toolbar
  40. button:hover:not(.ql-active)
  41. color: inactiveColor
  42. .ql-fill, .ql-stroke.ql-fill
  43. fill: inactiveColor
  44. .ql-stroke, .ql-stroke-miter
  45. stroke: inactiveColor
  46. .ql-{themeName}
  47. box-sizing: border-box
  48. *
  49. box-sizing: border-box
  50. .ql-hidden
  51. display: none
  52. .ql-out-bottom, .ql-out-top
  53. visibility: hidden
  54. .ql-tooltip
  55. position: absolute
  56. transform: translateY(10px)
  57. a
  58. cursor: pointer
  59. text-decoration: none
  60. .ql-tooltip.ql-flip
  61. transform: translateY(-10px)
  62. .ql-formats
  63. &:after
  64. clear: both
  65. content: ''
  66. display: table
  67. display: inline-block
  68. vertical-align: middle
  69. .ql-stroke
  70. fill: none
  71. stroke: inactiveColor
  72. stroke-linecap: round
  73. stroke-linejoin: round
  74. stroke-width: 2
  75. .ql-stroke-miter
  76. fill: none
  77. stroke: inactiveColor
  78. stroke-miterlimit: 10
  79. stroke-width: 2
  80. .ql-fill, .ql-stroke.ql-fill
  81. fill: inactiveColor
  82. .ql-empty
  83. fill: none
  84. .ql-even
  85. fill-rule: evenodd
  86. .ql-thin, .ql-stroke.ql-thin
  87. stroke-width: 1
  88. .ql-transparent
  89. opacity: 0.4
  90. .ql-direction
  91. svg:last-child
  92. display: none
  93. .ql-direction.ql-active
  94. svg:last-child
  95. display: inline
  96. svg:first-child
  97. display: none
  98. .ql-editor
  99. h1
  100. font-size: 2em
  101. h2
  102. font-size: 1.5em
  103. h3
  104. font-size: 1.17em
  105. h4
  106. font-size: 1em
  107. h5
  108. font-size: 0.83em
  109. h6
  110. font-size: 0.67em
  111. a
  112. text-decoration: underline
  113. blockquote
  114. border-left: 4px solid #ccc
  115. margin-bottom: 5px
  116. margin-top: 5px
  117. padding-left: 16px
  118. code, pre
  119. background-color: #f0f0f0
  120. border-radius: 3px
  121. pre
  122. white-space: pre-wrap
  123. margin-bottom: 5px
  124. margin-top: 5px
  125. padding: 5px 10px
  126. code
  127. font-size: 85%
  128. padding: 2px 4px
  129. pre.ql-syntax
  130. background-color: #23241f
  131. color: #f8f8f2;
  132. overflow: visible
  133. img
  134. max-width: 100%
  135. .ql-picker
  136. color: inactiveColor
  137. display: inline-block
  138. float: left
  139. font-size: 14px
  140. font-weight: 500
  141. height: controlHeight
  142. position: relative
  143. vertical-align: middle
  144. .ql-picker-label
  145. cursor: pointer
  146. display: inline-block
  147. height: 100%
  148. padding-left: 8px
  149. padding-right: 2px
  150. position: relative
  151. width: 100%
  152. &::before
  153. display: inline-block
  154. line-height: 22px
  155. .ql-picker-options
  156. background-color: backgroundColor
  157. display: none
  158. min-width: 100%
  159. padding: 4px 8px
  160. position: absolute
  161. white-space: nowrap
  162. .ql-picker-item
  163. cursor: pointer
  164. display: block
  165. padding-bottom: 5px
  166. padding-top: 5px
  167. .ql-picker.ql-expanded
  168. .ql-picker-label
  169. color: borderColor
  170. z-index: 2
  171. .ql-fill
  172. fill: borderColor
  173. .ql-stroke
  174. stroke: borderColor
  175. .ql-picker-options
  176. display: block
  177. margin-top: -1px
  178. top: 100%
  179. z-index: 1
  180. .ql-color-picker, .ql-icon-picker
  181. width: controlHeight + 4
  182. .ql-picker-label
  183. padding: 2px 4px
  184. svg
  185. right: 4px
  186. .ql-icon-picker
  187. .ql-picker-options
  188. padding: 4px 0px
  189. .ql-picker-item
  190. height: controlHeight
  191. width: controlHeight
  192. padding: 2px 4px
  193. .ql-color-picker
  194. .ql-picker-options
  195. padding: inputPaddingHeight inputPaddingWidth
  196. width: (colorItemSize + 2*colorItemMargin) * colorItemsPerRow + 2*inputPaddingWidth + 2 // +2 for the border
  197. .ql-picker-item
  198. border: 1px solid transparent
  199. float: left
  200. height: colorItemSize
  201. margin: colorItemMargin
  202. padding: 0px
  203. width: colorItemSize
  204. .ql-picker:not(.ql-color-picker):not(.ql-icon-picker)
  205. svg
  206. position: absolute
  207. margin-top: -9px
  208. right: 0
  209. top: 50%
  210. width: 18px
  211. .ql-picker.ql-header, .ql-picker.ql-font, .ql-picker.ql-size
  212. .ql-picker-label[data-label]:not([data-label='']),
  213. .ql-picker-item[data-label]:not([data-label=''])
  214. &::before
  215. content: attr(data-label)
  216. .ql-picker.ql-header
  217. width: 98px
  218. .ql-picker-label::before,
  219. .ql-picker-item::before
  220. content: 'Normal'
  221. for num in (1..6)
  222. .ql-picker-label[data-value=\"{num}\"]::before,
  223. .ql-picker-item[data-value=\"{num}\"]::before
  224. content: 'Heading ' + num
  225. .ql-picker-item[data-value="1"]::before
  226. font-size: 2em
  227. .ql-picker-item[data-value="2"]::before
  228. font-size: 1.5em
  229. .ql-picker-item[data-value="3"]::before
  230. font-size: 1.17em
  231. .ql-picker-item[data-value="4"]::before
  232. font-size: 1em
  233. .ql-picker-item[data-value="5"]::before
  234. font-size: 0.83em
  235. .ql-picker-item[data-value="6"]::before
  236. font-size: 0.67em
  237. .ql-picker.ql-font
  238. width: 108px
  239. .ql-picker-label::before,
  240. .ql-picker-item::before
  241. content: 'Sans Serif'
  242. .ql-picker-label[data-value=serif]::before,
  243. .ql-picker-item[data-value=serif]::before
  244. content: 'Serif'
  245. .ql-picker-label[data-value=monospace]::before,
  246. .ql-picker-item[data-value=monospace]::before
  247. content: 'Monospace'
  248. .ql-picker-item[data-value=serif]::before
  249. font-family: Georgia, Times New Roman, serif;
  250. .ql-picker-item[data-value=monospace]::before
  251. font-family: Monaco, Courier New, monospace;
  252. .ql-picker.ql-size
  253. width: 98px
  254. .ql-picker-label::before,
  255. .ql-picker-item::before
  256. content: 'Normal'
  257. .ql-picker-label[data-value=small]::before,
  258. .ql-picker-item[data-value=small]::before
  259. content: 'Small'
  260. .ql-picker-label[data-value=large]::before,
  261. .ql-picker-item[data-value=large]::before
  262. content: 'Large'
  263. .ql-picker-label[data-value=huge]::before,
  264. .ql-picker-item[data-value=huge]::before
  265. content: 'Huge'
  266. .ql-picker-item[data-value=small]::before
  267. font-size: 10px
  268. .ql-picker-item[data-value=large]::before
  269. font-size: 18px
  270. .ql-picker-item[data-value=huge]::before
  271. font-size: 32px
  272. .ql-color-picker.ql-background
  273. .ql-picker-item
  274. background-color: #fff;
  275. .ql-color-picker.ql-color
  276. .ql-picker-item
  277. background-color: #000;