nicegui.css 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. /* variables */
  2. :root {
  3. --nicegui-default-padding: 1rem;
  4. --nicegui-default-gap: 1rem;
  5. }
  6. /* prevent q-layout from getting strange outline when focussed */
  7. .nicegui-layout {
  8. outline: 2px solid transparent;
  9. outline-offset: 2px;
  10. }
  11. /* flex containers */
  12. .nicegui-content,
  13. .nicegui-header,
  14. .nicegui-footer,
  15. .nicegui-drawer,
  16. .nicegui-tab-panel,
  17. .nicegui-card,
  18. .nicegui-carousel-slide,
  19. .nicegui-step .q-stepper__nav,
  20. .nicegui-step .q-stepper__step-inner,
  21. .nicegui-expansion .q-expansion-item__content,
  22. .nicegui-scroll-area .q-scrollarea__content,
  23. .nicegui-splitter .q-splitter__panel,
  24. .nicegui-timeline-entry .q-timeline__content,
  25. .nicegui-row,
  26. .nicegui-column {
  27. display: flex;
  28. flex-direction: column;
  29. align-items: flex-start;
  30. gap: var(--nicegui-default-gap);
  31. padding: var(--nicegui-default-padding);
  32. }
  33. .nicegui-header,
  34. .nicegui-footer,
  35. .nicegui-step .q-stepper__nav,
  36. .nicegui-row {
  37. flex-direction: row;
  38. }
  39. .nicegui-row,
  40. .nicegui-column {
  41. padding: 0;
  42. }
  43. /* original padding for some Quasar elements */
  44. .nicegui-step .q-stepper__nav {
  45. padding: 8px 0 0 0;
  46. gap: 8px;
  47. }
  48. .nicegui-timeline-entry .q-timeline__content {
  49. padding: 0 0 24px 0;
  50. }
  51. .nicegui-splitter .q-splitter__panel {
  52. padding: 0;
  53. }
  54. /* let step content fill the whole stepper for easier layout manipulation (#1788) */
  55. .nicegui-stepper {
  56. display: flex;
  57. flex-direction: column;
  58. }
  59. .nicegui-stepper .q-stepper__content {
  60. flex-grow: 1;
  61. }
  62. .nicegui-stepper .q-stepper__step-content,
  63. .nicegui-stepper .q-stepper__step-inner {
  64. height: 100%;
  65. }
  66. /* HACK: avoid stutter when expansion item is toggled */
  67. .nicegui-expansion .q-expansion-item__content {
  68. padding: 0 var(--nicegui-default-padding);
  69. }
  70. .nicegui-expansion .q-expansion-item__content::before,
  71. .nicegui-expansion .q-expansion-item__content::after {
  72. content: ""; /* the gap compensates for the missing vertical padding */
  73. }
  74. /* revert Tailwind's CSS reset for ui.editor and ui.markdown */
  75. .nicegui-editor .q-editor__content h1,
  76. .nicegui-markdown h1 {
  77. font-size: 3rem;
  78. line-height: 1;
  79. margin-bottom: 1rem;
  80. margin-top: 1.5rem;
  81. font-weight: 300;
  82. }
  83. .nicegui-editor .q-editor__content h2,
  84. .nicegui-markdown h2 {
  85. font-size: 2.25rem;
  86. line-height: 2.5rem;
  87. margin-bottom: 0.75rem;
  88. margin-top: 1.25rem;
  89. font-weight: 300;
  90. }
  91. .nicegui-editor .q-editor__content h3,
  92. .nicegui-markdown h3 {
  93. font-size: 1.875rem;
  94. line-height: 2.25rem;
  95. margin-bottom: 0.5rem;
  96. margin-top: 1rem;
  97. font-weight: 400;
  98. }
  99. .nicegui-editor .q-editor__content h4,
  100. .nicegui-markdown h4 {
  101. font-size: 1.5rem;
  102. line-height: 2rem;
  103. margin-bottom: 0.25rem;
  104. margin-top: 0.75rem;
  105. font-weight: 400;
  106. }
  107. .nicegui-editor .q-editor__content h5,
  108. .nicegui-markdown h5 {
  109. font-size: 1.25rem;
  110. line-height: 1.75rem;
  111. margin-bottom: 0.125rem;
  112. margin-top: 0.5rem;
  113. font-weight: 400;
  114. }
  115. .nicegui-editor .q-editor__content h6,
  116. .nicegui-markdown h6 {
  117. font-size: 1.125rem;
  118. line-height: 1.75rem;
  119. margin-bottom: 0.125rem;
  120. margin-top: 0.5rem;
  121. font-weight: 500;
  122. }
  123. .nicegui-editor .q-editor__content a,
  124. .nicegui-markdown a {
  125. text-decoration-line: underline;
  126. color: rgb(37 99 235); /* blue-600 */
  127. }
  128. .nicegui-editor .q-editor__content a:hover,
  129. .nicegui-markdown a:hover {
  130. color: rgb(30 64 175); /* blue-800 */
  131. }
  132. .nicegui-editor .q-editor__content a:visited,
  133. .nicegui-markdown a:visited {
  134. color: rgb(147 51 234); /* purple-600 */
  135. }
  136. .nicegui-editor .q-editor__content hr,
  137. .nicegui-markdown hr {
  138. margin-block-start: 0.5em;
  139. margin-block-end: 0.5em;
  140. height: 1px;
  141. border-style: none;
  142. background-color: rgba(128, 128, 128, 0.25);
  143. }
  144. .nicegui-editor .q-editor__content ul,
  145. .nicegui-markdown ul {
  146. list-style-type: initial;
  147. padding-inline-start: 2.5rem;
  148. margin-block-start: 0.25rem;
  149. margin-block-end: 0.25rem;
  150. }
  151. .nicegui-editor .q-editor__content ol,
  152. .nicegui-markdown ol {
  153. list-style-type: decimal;
  154. padding-inline-start: 2.5rem;
  155. margin-block-start: 0.25rem;
  156. margin-block-end: 0.25rem;
  157. }
  158. .nicegui-editor .q-editor__content blockquote,
  159. .nicegui-markdown blockquote {
  160. border-left: 0.25rem solid #8884;
  161. padding: 0.25rem 1rem 0.25rem 1rem;
  162. margin: 0.5rem 0;
  163. }
  164. .nicegui-editor .q-editor__content p,
  165. .nicegui-markdown p {
  166. margin: 0.5rem 0;
  167. }
  168. .nicegui-editor .q-editor__content table,
  169. .nicegui-markdown table {
  170. border-collapse: collapse;
  171. margin: 0.5rem 0;
  172. }
  173. .nicegui-editor .q-editor__content th,
  174. .nicegui-markdown th {
  175. padding: 0.5rem;
  176. border: 1px solid #8884;
  177. }
  178. .nicegui-editor .q-editor__content td,
  179. .nicegui-markdown td {
  180. padding: 0.5rem;
  181. border: 1px solid #8884;
  182. }
  183. .nicegui-markdown .codehilite pre {
  184. margin: 0.5rem 0;
  185. }
  186. /* other NiceGUI elements */
  187. .nicegui-grid {
  188. display: grid;
  189. gap: var(--nicegui-default-gap);
  190. }
  191. .nicegui-link {
  192. text-decoration-line: underline;
  193. color: rgb(59 130 246);
  194. }
  195. .nicegui-link:hover,
  196. .nicegui-link:active {
  197. opacity: 0.8;
  198. }
  199. .nicegui-separator {
  200. width: 100%;
  201. }
  202. .nicegui-aggrid,
  203. .nicegui-echart,
  204. .nicegui-leaflet,
  205. .nicegui-scroll-area {
  206. width: 100%;
  207. height: 16rem;
  208. }
  209. .nicegui-log {
  210. padding: 0.25rem;
  211. border-width: 1px;
  212. white-space: pre;
  213. font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  214. opacity: 1 !important;
  215. cursor: text !important;
  216. }
  217. h6.q-timeline__title {
  218. font-size: 1.25rem;
  219. font-weight: 500;
  220. }
  221. .nicegui-code {
  222. position: relative;
  223. background-color: rgba(127, 159, 191, 0.1);
  224. border: 1pt solid rgba(127, 159, 191, 0.15);
  225. box-shadow: 0 0 0.5em rgba(127, 159, 191, 0.05);
  226. border-radius: 0.25rem;
  227. }
  228. .nicegui-code .codehilite {
  229. padding: 0 0.5rem;
  230. }
  231. /* connection popup */
  232. #popup {
  233. position: fixed;
  234. bottom: 0;
  235. left: 0;
  236. border: 1pt solid rgba(127, 159, 191, 0.25);
  237. border-radius: 0.25em;
  238. box-shadow: 0 0 0.5em rgba(127, 159, 191, 0.05);
  239. margin: 2em;
  240. padding: 1.5em 4em;
  241. display: flex;
  242. flex-direction: column;
  243. gap: 1em;
  244. opacity: 0;
  245. transition-duration: 500ms;
  246. pointer-events: none;
  247. z-index: 1000;
  248. }
  249. .body--dark #popup {
  250. background-color: black;
  251. }
  252. .body--light #popup {
  253. background-color: white;
  254. }
  255. #popup[style*="opacity: 1;"] {
  256. transition-delay: 2000ms;
  257. }
  258. #popup > span:first-child {
  259. font-weight: bold;
  260. }
  261. #popup > span:first-child::before {
  262. content: "⚠️";
  263. position: absolute;
  264. left: 1.5em;
  265. }