main.css 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269
  1. /* stylelint-disable import-notation */
  2. @import 'tailwindcss';
  3. @import './tokens.css';
  4. @import './transitions.css';
  5. @plugin '@formkit/themes/tailwindcss';
  6. @plugin '../../../build/zammadTailwindPlugin.js';
  7. @custom-variant dark (&:where([data-theme=dark], [data-theme=dark] * ));
  8. @layer base {
  9. /* Override autofill styles in Firefox. */
  10. :-moz-autofill {
  11. background: transparent;
  12. }
  13. /* Override autofill styles in Webkit-based browsers. */
  14. :-webkit-autofill {
  15. -webkit-text-fill-color: var(--color-black);
  16. -webkit-background-clip: text;
  17. caret-color: var(--color-black);
  18. }
  19. [data-theme='dark'] :-webkit-autofill {
  20. -webkit-text-fill-color: var(--color-white);
  21. caret-color: var(--color-white);
  22. }
  23. /* No-op animation for hooking into autofill mechanism in Webkit-based browsers. */
  24. :-webkit-autofill {
  25. animation-name: onAutoFillStart;
  26. }
  27. :not(:-webkit-autofill) {
  28. animation-name: onAutoFillEnd;
  29. }
  30. /* Better-looking typography on high-density screens. */
  31. body {
  32. @apply antialiased;
  33. }
  34. a {
  35. @apply outline-hidden focus-visible:outline-1 focus-visible:outline-offset-1 focus-visible:outline-blue-800;
  36. }
  37. @keyframes onAutoFillStart {
  38. from {
  39. }
  40. to {
  41. }
  42. }
  43. @keyframes onAutoFillEnd {
  44. from {
  45. }
  46. to {
  47. }
  48. }
  49. }
  50. @layer components {
  51. .grid-cols-2-uneven > *:nth-last-child(1):nth-child(odd) {
  52. grid-column: span 2;
  53. }
  54. input::placeholder,
  55. textarea::placeholder {
  56. @apply text-stone-200 dark:text-neutral-500;
  57. }
  58. /*
  59. Responsive multi-column mode for form groups:
  60. - compatibility layer for object attributes and form columns via legacy `.formGroup--halfSize` class
  61. - container query via optional TW `@container/form-group` class
  62. */
  63. .form-group .formkit-outer {
  64. /* stylelint-disable-next-line scss/operator-no-unspaced */
  65. @apply col-span-2 @lg/form-group:col-span-1;
  66. /* Optional full-width style for specific fields. */
  67. &[data-type='editor'],
  68. &[data-type='file'],
  69. &:last-of-type:nth-of-type(odd) {
  70. /* stylelint-disable-next-line scss/operator-no-unspaced */
  71. @apply @lg/form-group:col-span-2;
  72. }
  73. &.form-group-single-column {
  74. @apply col-span-1;
  75. }
  76. }
  77. /*
  78. Use specific selector for dirty flag styling due to nested FormKit fields.
  79. */
  80. [data-theme='dark']
  81. .form-group.form-group-mark-dirty
  82. > .formkit-outer[data-dirty]
  83. > .formkit-block
  84. > .formkit-wrapper
  85. > .formkit-inner {
  86. &::before {
  87. background: repeating-linear-gradient(
  88. 45deg,
  89. var(--color-gray-200),
  90. var(--color-gray-200) 5px,
  91. transparent 5px,
  92. transparent 10px
  93. )
  94. repeat center;
  95. }
  96. }
  97. .form-group.form-group-mark-dirty
  98. > .formkit-outer[data-dirty]
  99. > .formkit-block
  100. > .formkit-wrapper
  101. > .formkit-inner {
  102. @apply relative;
  103. &::before {
  104. @apply absolute top-0 bottom-0 w-2 rounded-ss-lg rounded-es-lg content-[''] ltr:left-0 rtl:right-0;
  105. background: repeating-linear-gradient(
  106. 45deg,
  107. var(--color-white),
  108. var(--color-white) 5px,
  109. transparent 5px,
  110. transparent 10px
  111. )
  112. repeat center;
  113. mask-image: linear-gradient(
  114. 90deg,
  115. var(--color-black),
  116. var(--color-black) 0.4rem,
  117. transparent 0.4rem,
  118. transparent
  119. );
  120. }
  121. }
  122. .tooltip {
  123. @apply fixed z-50 w-fit -translate-y-2 rounded-md border border-neutral-100 bg-blue-200 px-2 py-1 text-xs leading-snug text-wrap text-gray-100 opacity-0 transition-all select-none dark:border-gray-900 dark:bg-gray-700 dark:text-neutral-400;
  124. }
  125. .tooltip-animate {
  126. @apply translate-y-0 opacity-100;
  127. }
  128. /*
  129. Editor content styles
  130. */
  131. .Content,
  132. .ProseMirror {
  133. div[data-signature-marker] {
  134. display: none;
  135. }
  136. &:focus-visible {
  137. outline: none;
  138. }
  139. blockquote {
  140. @apply border-l-4 border-l-gray-200 px-3 py-2;
  141. }
  142. ol {
  143. list-style: decimal;
  144. }
  145. ul {
  146. list-style: disc;
  147. }
  148. ol,
  149. ul {
  150. @apply pb-2;
  151. padding-inline-start: 0.5rem;
  152. list-style-position: inside;
  153. p {
  154. display: inline;
  155. }
  156. }
  157. h1 {
  158. @apply mt-2 mb-1 text-2xl font-bold;
  159. }
  160. h2 {
  161. @apply mt-2 mb-1 text-xl font-bold;
  162. }
  163. h3 {
  164. @apply mt-2 mb-1 text-lg font-bold;
  165. }
  166. a {
  167. @apply text-blue-800;
  168. }
  169. [dir='rtl'] {
  170. text-align: right;
  171. }
  172. [dir='ltr'] {
  173. text-align: left;
  174. }
  175. }
  176. .bg-stripes::before {
  177. content: '';
  178. background-image: repeating-linear-gradient(
  179. 45deg,
  180. var(--color-blue-400),
  181. var(--color-blue-400) 5px,
  182. var(--color-blue-700) 5px,
  183. var(--color-blue-700) 10px
  184. );
  185. height: calc(100% + 10px);
  186. width: calc(100% + 10px);
  187. left: -5px;
  188. top: -5px;
  189. position: absolute;
  190. z-index: -10;
  191. }
  192. }
  193. [data-theme='dark'] .bg-stripes::before {
  194. background-image: repeating-linear-gradient(
  195. 45deg,
  196. var(--color-blue-700),
  197. var(--color-blue-700) 5px,
  198. var(--color-blue-900) 5px,
  199. var(--color-blue-900) 10px
  200. );
  201. }
  202. @utility group-block {
  203. @apply rounded-3xl bg-neutral-50 p-5 text-black dark:bg-gray-500 dark:text-white;
  204. }
  205. @utility backface-hidden {
  206. backface-visibility: hidden;
  207. }
  208. @utility required {
  209. @apply after:ms-1 after:inline-block after:font-extrabold after:text-yellow-600 after:content-['•'];
  210. }
  211. /* Uses to be in the @layer utilities */
  212. @media print {
  213. [data-print-mode='true'] body {
  214. @apply invisible;
  215. & .print-area {
  216. @apply visible fixed inset-0;
  217. }
  218. }
  219. }
  220. button,
  221. [role='button'] {
  222. cursor: pointer;
  223. }