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.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454
  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: "@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 introduced by IE10
  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. // Fallback spinner for browsers without CSS animations
  235. .v-ie8 &,
  236. .v-ie9 & {
  237. .v-loading-indicator,
  238. .v-loading-indicator-delay,
  239. .v-loading-indicator-wait {
  240. width: 28px !important;
  241. height: 28px;
  242. padding: round($v-unit-size/4);
  243. background: #fff url(#{$valo-shared-pathPrefix}img/spinner.gif) no-repeat 50%;
  244. border-radius: $v-border-radius;
  245. top: round($v-unit-size/4);
  246. right: round($v-unit-size/4);
  247. left: auto;
  248. filter: alpha(opacity=50);
  249. &[style*="none"] {
  250. display: none !important;
  251. }
  252. }
  253. .v-loading-indicator-wait {
  254. filter: alpha(opacity=100);
  255. }
  256. }
  257. .v-scrollable:focus {
  258. outline: none;
  259. }
  260. img.v-icon {
  261. vertical-align: middle;
  262. }
  263. .v-caption {
  264. @include valo-caption-style;
  265. }
  266. .v-caption-on-left .v-caption,
  267. .v-caption-on-right .v-caption {
  268. padding-top: 0;
  269. padding-bottom: 0;
  270. }
  271. .v-icon + .v-captiontext,
  272. .v-icon + span {
  273. margin-left: round($v-unit-size/5);
  274. &:empty {
  275. margin-left: 0;
  276. }
  277. }
  278. .v-errorindicator {
  279. @include valo-error-indicator-style;
  280. }
  281. .v-required-field-indicator {
  282. color: $v-required-field-indicator-color;
  283. padding: 0 .2em;
  284. }
  285. select {
  286. font: inherit;
  287. font-weight: 400;
  288. line-height: inherit;
  289. padding: round($v-unit-size/8);
  290. margin: 0;
  291. border-radius: $v-border-radius;
  292. @include valo-nativeselect-select-style;
  293. }
  294. button {
  295. font: inherit;
  296. font-weight: 400;
  297. line-height: $v-line-height;
  298. }
  299. a {
  300. @include valo-link-style;
  301. }
  302. .v-disabled {
  303. cursor: default !important;
  304. }
  305. @include valo-drag-element;
  306. @include valo-tooltip;
  307. @include valo-contextmenu;
  308. @include valo-reconnect-dialog;
  309. }
  310. /**
  311. * Generic component caption styles (captions which are generated by layouts).
  312. */
  313. @mixin valo-caption-style {
  314. font-size: $v-caption-font-size;
  315. font-weight: $v-caption-font-weight;
  316. padding-bottom: .3em;
  317. @if $v-border-radius > 0 {
  318. padding-left: round($v-border-radius/4);
  319. }
  320. }
  321. /**
  322. * Error indicator styles. The error indicator is by default a font character which you can style freely.
  323. *
  324. * @param {boolean} $is-pseudo-element (false) - is the selector including this mixin targeting a pseudo element
  325. *
  326. * @requires {mixin} valo-error-indicator-icon-style by default
  327. */
  328. @mixin valo-error-indicator-style ($is-pseudo-element: false) {
  329. color: $v-error-indicator-color;
  330. font-weight: 600;
  331. width: ceil($v-unit-size/2);
  332. text-align: center;
  333. @if $is-pseudo-element {
  334. @include valo-error-indicator-icon-style;
  335. } @else {
  336. &:before {
  337. @include valo-error-indicator-icon-style;
  338. }
  339. }
  340. }
  341. /**
  342. * The error indicator icon style. Should be a font character or a font icon.
  343. */
  344. @mixin valo-error-indicator-icon-style {
  345. content: "!";
  346. }
  347. /**
  348. * Make the BODY element scrollable instead of the .v-ui element. Scrolling the BODY usually
  349. * works better on touch devices. You loose the ability to control the scroll position from
  350. * the server side when using this.
  351. *
  352. * @example scss
  353. * // Include without any parent selector
  354. * @include valo-natural-page-scrolling;
  355. */
  356. @mixin valo-natural-page-scrolling {
  357. html {
  358. height: auto;
  359. }
  360. .v-generated-body {
  361. height: auto;
  362. overflow: auto;
  363. background-color: $v-app-background-color;
  364. }
  365. .v-app,
  366. .v-ui.v-scrollable {
  367. width: auto !important;
  368. height: auto !important;
  369. overflow: visible !important;
  370. }
  371. }