You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

_global.scss 9.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430
  1. @import "loading-indicator";
  2. @import "contextmenu";
  3. @import "overlay";
  4. @import "tooltip";
  5. @import "reconnect-dialog";
  6. /*
  7. * A flag which is set to true when the global styles have been included in the compilation.
  8. * Used to only include them once, if Valo is imported multiple times during the compilation
  9. * (multiple theme support).
  10. *
  11. * @access private
  12. * @type bool
  13. */
  14. $valo-global-included: false !default;
  15. /*
  16. * Global Valo related styles, containing styles which are necessary for the application
  17. * and widgets to work correctly.
  18. *
  19. * @access private
  20. */
  21. @mixin valo-global {
  22. @if $valo-global-included == false {
  23. // Version info for the debug window
  24. .v-vaadin-version:after {
  25. content: "${project.version}";
  26. }
  27. // Core widget styles come before any other component (and are always included),
  28. // so that it has the least specificity
  29. @include valo-widget;
  30. .v-generated-body {
  31. overflow: hidden;
  32. margin: 0;
  33. padding: 0;
  34. border: 0;
  35. }
  36. .v-app {
  37. height: 100%;
  38. // Cancel tap highlight from all elements inside the app
  39. -webkit-tap-highlight-color: rgba(0,0,0,0);
  40. // Prevent iOS text size adjust after orientation change, without disabling user zoom
  41. -webkit-text-size-adjust: 100%;
  42. -ms-text-size-adjust: 100%;
  43. -webkit-text-size-adjust: 100%;
  44. // Disable text selection by default
  45. @include user-select(none);
  46. // Enable text selection for certain elements
  47. input[type="text"],
  48. .v-slot > .v-caption,
  49. .v-gridlayout-slot > .v-caption,
  50. .v-has-caption > .v-caption,
  51. .v-formlayout-captioncell > .v-caption,
  52. .v-csslayout > .v-caption {
  53. @include user-select(text);
  54. }
  55. // Removes clear button from input fields
  56. input::-ms-clear {
  57. display: none;
  58. }
  59. }
  60. .v-ui {
  61. position: relative;
  62. }
  63. // Prevent margin collapse
  64. .v-ui.v-ui-embedded {
  65. margin-top: -1px;
  66. border-top: 1px solid transparent;
  67. }
  68. .v-ui:focus {
  69. outline: none;
  70. }
  71. .v-overlay-container {
  72. width: 0;
  73. height: 0;
  74. }
  75. .v-drag-element {
  76. z-index: 60000;
  77. // Override any other position properties
  78. position: absolute !important;
  79. cursor: default;
  80. }
  81. .v-clip {
  82. overflow: hidden;
  83. }
  84. .v-scrollable {
  85. overflow: auto;
  86. // "Unnecessary scrollbar" related fixes
  87. > .v-widget {
  88. // This is needed for IE
  89. vertical-align: middle;
  90. // Needed for all browsers. Can't really show anything outside the
  91. // scrolling area anyway, so we can safely hide any overflow
  92. overflow: hidden;
  93. }
  94. }
  95. .v-ios.v-webkit .v-scrollable {
  96. -webkit-overflow-scrolling: touch;
  97. }
  98. // Disable native scrolling on iOS 5 due to issue #8792
  99. .v-ios5.v-webkit .v-scrollable {
  100. -webkit-overflow-scrolling: none;
  101. }
  102. //fix for #14813 - unable to scroll on iOS devices
  103. .v-webkit.v-ios .v-browserframe {
  104. -webkit-overflow-scrolling: touch;
  105. overflow:auto;
  106. }
  107. .v-assistive-device-only {
  108. position: absolute;
  109. top: -2000px;
  110. left: -2000px;
  111. width: 10px;
  112. overflow: hidden;
  113. }
  114. .v-icon {
  115. cursor: inherit;
  116. @include user-select(none);
  117. }
  118. .v-icon,
  119. .v-errorindicator,
  120. .v-required-field-indicator {
  121. display: inline-block;
  122. line-height: inherit;
  123. }
  124. .v-caption {
  125. display: inline-block;
  126. white-space: nowrap;
  127. line-height: $v-line-height;
  128. }
  129. .v-captiontext {
  130. display: inline-block;
  131. line-height: inherit;
  132. }
  133. // Component global styles should also be included here
  134. @if v-is-included(orderedlayout) {
  135. @include valo-orderedlayout-global;
  136. }
  137. @if v-is-included(gridlayout) {
  138. @include valo-gridlayout-global;
  139. }
  140. @if v-is-included(calendar) {
  141. @include valo-calendar-global;
  142. }
  143. @if v-is-included(colorpicker) {
  144. @include valo-colorpicker-global;
  145. }
  146. @if v-is-included(table) or v-is-included(treetable) {
  147. @include valo-table-global;
  148. }
  149. @if v-is-included(tabsheet) {
  150. @include valo-tabsheet-global;
  151. }
  152. @if v-is-included(splitpanel) {
  153. @include valo-splitpanel-global;
  154. }
  155. $valo-global-included: true;
  156. }
  157. }
  158. $valo-shared-pathPrefix: null;
  159. @if $v-relative-paths == false {
  160. $valo-shared-pathPrefix: "../valo/shared/";
  161. }
  162. /**
  163. * Styles for the application root element. Outputs font, font color, background color and default
  164. * cursor styles.
  165. */
  166. @mixin valo-app-style {
  167. font: $v-font-weight #{$v-font-size}/#{$v-line-height} $v-font-family;
  168. color: $v-font-color;
  169. background-color: $v-app-background-color;
  170. cursor: default;
  171. // Default to Helvetica Neue on Macs instead of Helvetica, which has a slightly different baseline
  172. @if $v-font-family == sans-serif {
  173. .v-mac & {
  174. font-family: "Helvetica Neue", sans-serif;
  175. }
  176. }
  177. }
  178. /**
  179. * Common application styles, such as loading indicators, tooltip and context menu styles,
  180. * caption and icon defaults, basic HTML element resets.
  181. * Should only be included once (done automatically when including the main valo mixin).
  182. *
  183. * @requires {mixin} valo-app-style
  184. */
  185. @mixin valo-common {
  186. //@if & != null {
  187. // &,
  188. // &.v-app-loading {
  189. // @include valo-app-style;
  190. // }
  191. //} @else {
  192. &.v-app,
  193. &.v-app-loading {
  194. @include valo-app-style;
  195. }
  196. //}
  197. //&.v-overlay-container {
  198. // position: absolute;
  199. // top: 0;
  200. //}
  201. .v-app-loading {
  202. width: 100%;
  203. height: 100%;
  204. background: $v-app-background-color;
  205. $_size: 28px + round($v-unit-size/2);
  206. &:before {
  207. content: "";
  208. position: fixed;
  209. z-index: 100;
  210. top: 45%;
  211. left: 50%;
  212. width: 28px;
  213. height: 28px;
  214. padding: round($v-unit-size/4);
  215. margin-top: round($_size/-2);
  216. margin-left: round($_size/-2);
  217. background: #fff url(#{$valo-shared-pathPrefix}img/spinner.gif) no-repeat 50%;
  218. border-radius: $v-border-radius;
  219. }
  220. @if $v-app-loading-text != "" {
  221. &:after {
  222. position: fixed;
  223. z-index: 100;
  224. top: 45%;
  225. padding-top: $_size;
  226. text-align: center;
  227. left: 0;
  228. right: 0;
  229. content: $v-app-loading-text;
  230. }
  231. }
  232. }
  233. @include valo-loading-bar;
  234. .v-scrollable:focus {
  235. outline: none;
  236. }
  237. img.v-icon {
  238. vertical-align: middle;
  239. }
  240. .v-caption {
  241. @include valo-caption-style;
  242. }
  243. .v-caption-on-left .v-caption,
  244. .v-caption-on-right .v-caption {
  245. padding-top: 0;
  246. padding-bottom: 0;
  247. }
  248. .v-icon + .v-captiontext,
  249. .v-icon + span {
  250. margin-left: round($v-unit-size/5);
  251. &:empty {
  252. margin-left: 0;
  253. }
  254. }
  255. .v-errorindicator {
  256. @include valo-error-indicator-style;
  257. }
  258. .v-required-field-indicator {
  259. color: $v-required-field-indicator-color;
  260. padding: 0 .2em;
  261. }
  262. select {
  263. font: inherit;
  264. font-weight: 400;
  265. line-height: inherit;
  266. padding: round($v-unit-size/8);
  267. margin: 0;
  268. border-radius: $v-border-radius;
  269. @include valo-nativeselect-select-style;
  270. }
  271. button {
  272. font: inherit;
  273. font-weight: 400;
  274. line-height: $v-line-height;
  275. }
  276. a {
  277. @include valo-link-style;
  278. }
  279. .v-disabled {
  280. cursor: default !important;
  281. }
  282. @include valo-drag-element;
  283. @include valo-draggable;
  284. @include valo-tooltip;
  285. @include valo-contextmenu;
  286. @include valo-reconnect-dialog;
  287. }
  288. /**
  289. * Generic component caption styles (captions which are generated by layouts).
  290. */
  291. @mixin valo-caption-style {
  292. font-size: $v-caption-font-size;
  293. font-weight: $v-caption-font-weight;
  294. padding-bottom: .3em;
  295. @if $v-border-radius > 0 {
  296. padding-left: round($v-border-radius/4);
  297. }
  298. }
  299. /**
  300. * Error indicator styles. The error indicator is by default a font character which you can style freely.
  301. *
  302. * @param {boolean} $is-pseudo-element (false) - is the selector including this mixin targeting a pseudo element
  303. *
  304. * @requires {mixin} valo-error-indicator-icon-style by default
  305. */
  306. @mixin valo-error-indicator-style ($is-pseudo-element: false) {
  307. color: $v-error-indicator-color;
  308. font-weight: 600;
  309. width: ceil($v-unit-size/2);
  310. text-align: center;
  311. @if $is-pseudo-element {
  312. @include valo-error-indicator-icon-style;
  313. } @else {
  314. &:before {
  315. @include valo-error-indicator-icon-style;
  316. }
  317. }
  318. }
  319. /**
  320. * The error indicator icon style. Should be a font character or a font icon.
  321. */
  322. @mixin valo-error-indicator-icon-style {
  323. content: "!";
  324. }
  325. /**
  326. * Make the BODY element scrollable instead of the .v-ui element. Scrolling the BODY usually
  327. * works better on touch devices. You loose the ability to control the scroll position from
  328. * the server side when using this.
  329. *
  330. * @example scss
  331. * // Include without any parent selector
  332. * @include valo-natural-page-scrolling;
  333. */
  334. @mixin valo-natural-page-scrolling {
  335. html {
  336. height: auto;
  337. }
  338. .v-generated-body {
  339. height: auto;
  340. overflow: auto;
  341. background-color: $v-app-background-color;
  342. }
  343. .v-app,
  344. .v-ui.v-scrollable {
  345. width: auto !important;
  346. height: auto !important;
  347. overflow: visible !important;
  348. }
  349. }