application.scss 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. @use 'sass:math';
  2. @use '_variables' as *;
  3. @use '_mixins' as *;
  4. @use '_icons' as *;
  5. @use '_fonts';
  6. @use './class-helpers';
  7. @use './custom-markup';
  8. @use './ng-select';
  9. @use './bootstrap';
  10. @use './primeng-custom';
  11. @use './z-index';
  12. body {
  13. /*** theme ***/
  14. // now beware sass requires interpolation
  15. // for css custom properties #{$var}
  16. --mainColor: #{$main-color};
  17. --mainColorLighter: #{$main-color-lighter};
  18. --mainColorLightest: #{$main-color-lightest};
  19. --mainColorVeryLight: #{$main-color-very-light};
  20. --mainHoverColor: #{$main-hover-color};
  21. --mainBackgroundHoverColor: #{$main-background-hover-color};
  22. --mainBackgroundColor: #{$bg-color};
  23. --mainForegroundColor: #{$fg-color};
  24. --greyForegroundColor: #{$grey-foreground-color};
  25. --greyBackgroundColor: #{$grey-background-color};
  26. --greySecondaryBackgroundColor: #{$grey-background-hover-color};
  27. --menuBackgroundColor: #{$menu-background};
  28. --menuForegroundColor: #{$menu-color};
  29. --submenuBackgroundColor: #{$sub-menu-background-color};
  30. --channelBackgroundColor: #{$channel-background-color};
  31. --inputForegroundColor: #{$input-foreground-color};
  32. --inputBackgroundColor: #{$input-background-color};
  33. --inputPlaceholderColor: #{$input-placeholder-color};
  34. --inputBorderColor: #{$input-border-color};
  35. --textareaForegroundColor: #{$textarea-foreground-color};
  36. --textareaBackgroundColor: #{$textarea-background-color};
  37. --markdownTextareaBackgroundColor: #{$markdown-textarea-background-color};
  38. --actionButtonColor: #{$grey-foreground-color};
  39. --supportButtonBackgroundColor: #{transparent};
  40. --supportButtonColor: #{pvar(--actionButtonColor)};
  41. --supportButtonHeartColor: #{$support-button-heart};
  42. --activatedActionButtonColor: #{$activated-action-button-color};
  43. --horizontalMarginContent: #{$not-expanded-horizontal-margins};
  44. --videosHorizontalMarginContent: 6vw;
  45. --mainColWidth: calc(100vw - #{$menu-width});
  46. font-family: $main-fonts;
  47. font-weight: $font-regular;
  48. color: pvar(--mainForegroundColor);
  49. background-color: pvar(--mainBackgroundColor);
  50. font-size: 1rem;
  51. // On desktop browsers, make sure vertical scroll bar is always visible
  52. // Allow to disable the scrollbar instead of hide it when the content fit the body
  53. // And not move the content and header horizontally sticked to right when the content is updating
  54. overflow-y: scroll;
  55. // Fix "reboot" style that set text-align: left
  56. text-align: start;
  57. }
  58. ::selection {
  59. color: pvar(--mainBackgroundColor);
  60. background-color: pvar(--mainHoverColor);
  61. }
  62. noscript,
  63. #incompatible-browser {
  64. display: block;
  65. font-size: 1.2rem;
  66. max-width: 600px;
  67. margin: 1rem auto;
  68. }
  69. a {
  70. text-decoration: none;
  71. }
  72. strong {
  73. font-weight: $font-semibold;
  74. }
  75. input[readonly] {
  76. /* Force blank on readonly inputs */
  77. background-color: pvar(--inputBackgroundColor) !important;
  78. }
  79. input,
  80. textarea {
  81. outline: none;
  82. color: pvar(--inputForegroundColor);
  83. }
  84. button {
  85. @include disable-outline;
  86. background: unset;
  87. }
  88. label {
  89. font-weight: $font-bold;
  90. margin-bottom: 0.5rem;
  91. }
  92. code {
  93. background-color: pvar(--greyBackgroundColor);
  94. color: pvar(--greyForegroundColor);
  95. border-radius: 3px;
  96. padding: .2em .4em;
  97. margin: auto .4em;
  98. font-size: 75%;
  99. display: inline-block;
  100. vertical-align: middle;
  101. }
  102. .main-col {
  103. @include margin-left($menu-width);
  104. width: calc(100% - #{$menu-width});
  105. outline: none;
  106. .margin-content {
  107. margin: 0 pvar(--horizontalMarginContent);
  108. flex-grow: 1;
  109. }
  110. .sub-menu {
  111. background-color: pvar(--submenuBackgroundColor);
  112. width: 100%;
  113. display: flex;
  114. align-items: center;
  115. padding: 0 pvar(--horizontalMarginContent);
  116. height: $sub-menu-height;
  117. margin-bottom: $sub-menu-margin-bottom;
  118. overflow-x: auto;
  119. &.sub-menu-fixed {
  120. position: fixed;
  121. z-index: #{z('sub-menu') - 1};
  122. max-width: pvar(--mainColWidth);
  123. }
  124. }
  125. // Use an appropriate offset top when sub-menu fixed
  126. .margin-content.offset-content {
  127. padding-top: $sub-menu-height + $sub-menu-margin-bottom;
  128. }
  129. // Override some properties if the main content is expanded (no menu on the left)
  130. &.expanded {
  131. --horizontalMarginContent: #{$expanded-horizontal-margins};
  132. --mainColWidth: 100vw;
  133. @include margin-left(0);
  134. width: 100%;
  135. }
  136. &.lock-scroll .main-row > router-outlet + * { /* stylelint-disable-line selector-max-compound-selectors */
  137. // Lock and hide body scrollbars
  138. position: fixed;
  139. // Lock and hide sub-menu scrollbars
  140. .sub-menu { /* stylelint-disable-line */
  141. overflow-x: hidden;
  142. }
  143. }
  144. }
  145. // In tables, don't have a hover different background
  146. table {
  147. my-edit-button,
  148. my-delete-button {
  149. .action-button {
  150. &:hover,
  151. &:active,
  152. &:focus,
  153. &[disabled],
  154. &.disabled {
  155. background-color: pvar(--greyBackgroundColor) !important;
  156. opacity: 0.8;
  157. }
  158. }
  159. }
  160. }
  161. my-global-icon[iconName=external-link] {
  162. margin: 0 0.3em;
  163. width: 0.9em;
  164. height: 0.9em;
  165. display: inline-block;
  166. color: pvar(--inputPlaceholderColor);
  167. position: relative;
  168. top: -0.1em;
  169. }
  170. @media screen and (max-width: #{breakpoint(xxl)}) {
  171. .main-col {
  172. --horizontalMarginContent: #{math.div($not-expanded-horizontal-margins, 2)};
  173. --videosHorizontalMarginContent: 30px;
  174. &.expanded {
  175. --horizontalMarginContent: #{math.div($expanded-horizontal-margins, 2)};
  176. }
  177. }
  178. }
  179. @media screen and (max-width: #{breakpoint(lg)}) {
  180. .main-col {
  181. --videosHorizontalMarginContent: #{pvar(--horizontalMarginContent)};
  182. }
  183. /* the following applies from 500px to 900px and is partially overridden from 500px to 800px by changes below to $small-view */
  184. .main-col,
  185. .main-col.expanded {
  186. --horizontalMarginContent: #{math.div($expanded-horizontal-margins, 3)};
  187. .sub-menu {
  188. padding: 0 50px;
  189. .title-page {
  190. font-size: 17px;
  191. }
  192. }
  193. }
  194. }
  195. @media screen and (min-width: $mobile-view) and (max-width: $small-view) {
  196. .main-col {
  197. width: 100%;
  198. }
  199. }
  200. @media screen and (max-width: $small-view) {
  201. .main-col,
  202. .main-col.expanded {
  203. --horizontalMarginContent: 15px;
  204. @include margin-left(0);
  205. .sub-menu {
  206. width: 100vw;
  207. padding: 0 15px;
  208. margin-bottom: $sub-menu-margin-bottom-small-view;
  209. overflow-x: auto;
  210. }
  211. // Use an appropriate offset top when sub-menu fixed
  212. .margin-content.offset-content {
  213. padding-top: $sub-menu-height + $sub-menu-margin-bottom-small-view;
  214. }
  215. my-markdown-textarea {
  216. .root {
  217. max-width: 100% !important;
  218. }
  219. }
  220. input[type=text],
  221. input[type=password],
  222. input[type=email],
  223. textarea,
  224. .peertube-select-container {
  225. flex-grow: 1;
  226. }
  227. .caption input[type=text] {
  228. width: unset !important;
  229. flex-grow: 1;
  230. }
  231. }
  232. }