gitea源码

segment.css 4.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. /* based on Fomantic UI segment module, with just the parts extracted that we use. If you find any
  2. unused rules here after refactoring, please remove them. */
  3. .ui.segment {
  4. position: relative;
  5. margin: 1rem 0;
  6. padding: 1em;
  7. border-radius: 0.28571429rem;
  8. border: 1px solid var(--color-secondary);
  9. background: var(--color-box-body);
  10. color: var(--color-text);
  11. }
  12. .ui.segment:first-child {
  13. margin-top: 0;
  14. }
  15. .ui.segment:last-child {
  16. margin-bottom: 0;
  17. }
  18. .ui.grid.segment {
  19. margin: 1rem 0;
  20. border-radius: 0.28571429rem;
  21. }
  22. .ui.segment.tab:last-child {
  23. margin-bottom: 1rem;
  24. }
  25. .ui.segments {
  26. flex-direction: column;
  27. position: relative;
  28. margin: 1rem 0;
  29. border: 1px solid var(--color-secondary);
  30. border-radius: 0.28571429rem;
  31. background: var(--color-box-body);
  32. color: var(--color-text);
  33. }
  34. .ui.segments:first-child {
  35. margin-top: 0;
  36. }
  37. .ui.segments:last-child {
  38. margin-bottom: 0;
  39. }
  40. .ui.segments > .segment {
  41. top: 0;
  42. bottom: 0;
  43. border-radius: 0;
  44. margin: 0;
  45. width: auto;
  46. box-shadow: none;
  47. border: none;
  48. border-top: 1px solid var(--color-secondary);
  49. }
  50. .ui.segments:not(.horizontal) > .segment:first-child {
  51. top: 0;
  52. bottom: 0;
  53. border-top: none;
  54. margin-top: 0;
  55. margin-bottom: 0;
  56. border-radius: 0.28571429rem 0.28571429rem 0 0;
  57. }
  58. .ui.segments:not(.horizontal) > .segment:last-child {
  59. top: 0;
  60. bottom: 0;
  61. margin-top: 0;
  62. margin-bottom: 0;
  63. border-radius: 0 0 0.28571429rem 0.28571429rem;
  64. }
  65. .ui.segments:not(.horizontal) > .segment:only-child,
  66. .ui.segments:not(.horizontal) > .segment:has(~ .tw-hidden) { /* workaround issue with :last-child ignoring hidden elements */
  67. border-radius: 0.28571429rem;
  68. }
  69. .ui.segments > .ui.segments {
  70. border-top: 1px solid var(--color-secondary);
  71. margin: 1rem;
  72. }
  73. .ui.segments > .segments:first-child {
  74. border-top: none;
  75. }
  76. .ui.segments > .segment + .segments:not(.horizontal) {
  77. margin-top: 0;
  78. }
  79. .ui.horizontal.segments {
  80. display: flex;
  81. flex-direction: row;
  82. background-color: transparent;
  83. padding: 0;
  84. margin: 1rem 0;
  85. border-radius: 0.28571429rem;
  86. border: 1px solid var(--color-secondary);
  87. }
  88. .ui.horizontal.segments > .segment {
  89. margin: 0;
  90. min-width: 0;
  91. border-radius: 0;
  92. border: none;
  93. box-shadow: none;
  94. border-left: 1px solid var(--color-secondary);
  95. }
  96. .ui.segments > .horizontal.segments:first-child {
  97. border-top: none;
  98. }
  99. .ui.horizontal.segments:not(.stackable) > .segment:first-child {
  100. border-left: none;
  101. }
  102. .ui.horizontal.segments > .segment:first-child {
  103. border-radius: 0.28571429rem 0 0 0.28571429rem;
  104. }
  105. .ui.horizontal.segments > .segment:last-child {
  106. border-radius: 0 0.28571429rem 0.28571429rem 0;
  107. }
  108. .ui.clearing.segment::after {
  109. content: "";
  110. display: block;
  111. clear: both;
  112. }
  113. .ui.secondary.segment {
  114. background: var(--color-secondary-bg);
  115. color: var(--color-text-light);
  116. }
  117. .ui.attached.segment {
  118. top: 0;
  119. bottom: 0;
  120. border-radius: 0;
  121. margin: 0 -1px;
  122. width: calc(100% + 2px);
  123. max-width: calc(100% + 2px);
  124. box-shadow: none;
  125. border: 1px solid var(--color-secondary);
  126. background: var(--color-box-body);
  127. color: var(--color-text);
  128. }
  129. .ui.attached:not(.message) + .ui.attached.segment:not(.top) {
  130. border-top: none;
  131. }
  132. .ui.attached.segment:has(+ .ui[class*="top attached"].header),
  133. .ui.attached.segment:has(+ .page.buttons),
  134. .ui.attached.segment:last-child,
  135. .ui.segment:has(+ .ui.segment:not(.attached)),
  136. .ui.attached.segment:has(+ .ui.modal) {
  137. border-bottom-left-radius: 0.28571429rem;
  138. border-bottom-right-radius: 0.28571429rem;
  139. }
  140. .ui[class*="top attached"].segment {
  141. bottom: 0;
  142. margin-bottom: 0;
  143. top: 0;
  144. margin-top: 1rem;
  145. border-radius: 0.28571429rem 0.28571429rem 0 0;
  146. }
  147. .ui.segment[class*="top attached"]:first-child {
  148. margin-top: 0;
  149. }
  150. .ui[class*="top attached"].segment:last-child {
  151. border-top-left-radius: 0.28571429rem;
  152. border-top-right-radius: 0.28571429rem;
  153. }
  154. .ui.segment[class*="bottom attached"] {
  155. bottom: 0;
  156. margin-top: 0;
  157. top: 0;
  158. margin-bottom: 1rem;
  159. border-radius: 0 0 0.28571429rem 0.28571429rem;
  160. }
  161. .ui.segment[class*="bottom attached"]:last-child {
  162. margin-bottom: 1rem;
  163. }
  164. .ui.fitted.segment:not(.horizontally) {
  165. padding-top: 0;
  166. padding-bottom: 0;
  167. }
  168. .ui.fitted.segment:not(.vertically) {
  169. padding-left: 0;
  170. padding-right: 0;
  171. }
  172. .ui.segments .segment,
  173. .ui.segment {
  174. font-size: 1rem;
  175. }
  176. .ui.error.segment {
  177. border-color: var(--color-error-border) !important;
  178. }
  179. .ui.warning.segment {
  180. border-color: var(--color-warning-border) !important;
  181. }