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.

_variables.scss 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540
  1. // Color functions are used to calculate default font color
  2. @import "../util/color";
  3. /**
  4. * A static text that is shown under the loading spinned while the client-side
  5. * engine is being loaded and started. The text must be given in quotes. The
  6. * text can not be localized currently.
  7. *
  8. * @type string, quoted
  9. */
  10. $v-app-loading-text: "" !default;
  11. /**
  12. * Base line height for all widgets. It must be given a unitless number.
  13. *
  14. * @group typography
  15. * @type number
  16. */
  17. $v-line-height: 1.55 !default;
  18. /**
  19. * Base font size for the theme. The font size defines the overall sizing of
  20. * UI components by default. Must be specified in pixels.
  21. *
  22. * @group typography
  23. * @type size (px)
  24. */
  25. $v-font-size: 16px !default;
  26. /**
  27. * Base font weight for plain text.
  28. * Must be specified as a numeric value: 100, 200, 300 (light), 400 (regular),
  29. * 500, 600, 700 (bold), 800 or 900.
  30. *
  31. * @group typography
  32. * @type number
  33. */
  34. $v-font-weight: 300 !default;
  35. /**
  36. * Base font family for the theme. Can be any valid CSS font stack.
  37. *
  38. * @group typography
  39. * @type list
  40. */
  41. $v-font-family: "Open Sans", sans-serif !default;
  42. /**
  43. * Font size for generic component captions. Can be any valid CSS font-size. A
  44. * round pixel value is recommended.
  45. *
  46. * @group typography
  47. * @type number
  48. */
  49. $v-caption-font-size: round($v-font-size * 0.9) !default;
  50. /**
  51. * Font weight for generic component captions. Can be any valid CSS font-weight.
  52. *
  53. * @group typography
  54. * @type number | identifier
  55. */
  56. $v-caption-font-weight: max(400, $v-font-weight) !default;
  57. /**
  58. * Border specification for the components that have a border. The border width
  59. * must be specified in pixels. For the border color, you can specify any CSS color
  60. * or one of the v-tint, v-shade, and v-tone keywords.
  61. *
  62. * @group style
  63. * @type list
  64. */
  65. $v-border: 1px solid (v-shade 0.7) !default;
  66. /**
  67. * Corner radius for components that have a border. The measure must be specified as a
  68. * single pixel value (i.e. not as a list of values for each corner).
  69. *
  70. * @group style
  71. * @type size (px)
  72. */
  73. $v-border-radius: 4px !default;
  74. /**
  75. * Color gradient style for components that have a gradient. The gradient style may use
  76. * the following keywords: v-linear and v-linear-reverse. The opacity must be given
  77. * as percentage between 0% and 100%.
  78. *
  79. * #### Gradient styles
  80. *
  81. * - __v-linear__ - The start of the gradient is a lighter shade of the base color and the end is a darker shade of the base color. A basic linear gradient.
  82. * - __v-linear-reverse__ - Same as v-linear, but the color stops are reversed (darker at the start and lighter at the end)
  83. *
  84. * @group style
  85. * @type list
  86. */
  87. $v-gradient: v-linear 8% !default;
  88. /**
  89. * Inset shadow style to define how some components are "raised" from the background.
  90. * The value follows the syntax of CSS box-shadow, and should be a list of insets.
  91. * For the bevel color, you can specify any CSS color or one of the v-tint, v-shade,
  92. * and v-tone keywords.
  93. *
  94. * @group style
  95. * @type list
  96. */
  97. $v-bevel: inset 0 1px 0 v-tint, inset 0 -1px 0 v-shade !default;
  98. /**
  99. * Specifies the "depth" of the bevel shadow, as applied to one of the color keywords for
  100. * the bevel style. The actual amount of tint, shade, or tone is computed from the depth.
  101. *
  102. * @group style
  103. * @type number (pct)
  104. */
  105. $v-bevel-depth: 30% !default;
  106. /**
  107. * Default shadow style for all components. As with $v-bevel, the value follows the syntax
  108. * of CSS box-shadow, but without the inset. For the shadow color, you can specify any CSS
  109. * color or one of the v-tint or v-shade keywords.
  110. *
  111. * @group style
  112. * @type list
  113. */
  114. $v-shadow: 0 2px 3px v-shade !default;
  115. /**
  116. * Specifies the opacity of the shadow, as applied to one of the color keywords for the
  117. * shadow style. The actual amount of tint or shade is computed from the depth.
  118. *
  119. * @group style
  120. * @type number (pct)
  121. */
  122. $v-shadow-opacity: 5% !default;
  123. /**
  124. * The background color is the main control parameter for the Valo theme and
  125. * it is used for computing all other colors in the theme. If the color is dark
  126. * (has low luminance), * light foreground colors that give high contrast
  127. * with the background are automatically used.
  128. *
  129. * Can be any valid CSS color.
  130. *
  131. * @group color
  132. * @type color
  133. */
  134. $v-background-color: hsl(210, 0%, 98%) !default;
  135. /**
  136. * Background color of the UI's root element. You can specify the color in
  137. * any way allowed in CSS. Used as the base for other default colors, such
  138. * as panel and window content areas.
  139. *
  140. * Can be any valid CSS color.
  141. *
  142. * @group color
  143. * @type color
  144. */
  145. $v-app-background-color: $v-background-color !default;
  146. /**
  147. * Base font color for the theme. Can be any valid CSS color.
  148. *
  149. * @group color
  150. * @type color
  151. */
  152. $v-font-color: valo-font-color($v-app-background-color) !default;
  153. /**
  154. * Color for the field focus indicator. The valo-focus-color() function computes a
  155. * high-contrast color from the context, which is usually the background color. The color
  156. * can be any CSS color.
  157. *
  158. * @group color
  159. * @type color
  160. */
  161. $v-focus-color: valo-focus-color() !default;
  162. /**
  163. * Box-shadow specification for the field focus indicator. The space-separated values
  164. * are the horizontal shadow position in pixels, vertical shadow position in pixels,
  165. * blur distance in pixels, spread distance in pixels, and the color. The color can be
  166. * any CSS color. You can only specify the color, in which case defaults for the position
  167. * are used. rgba() or hsla() can be used to enable transparency.
  168. *
  169. * @group style
  170. * @type list | color
  171. */
  172. $v-focus-style: 0 0 0 2px rgba($v-focus-color, .5) !default;
  173. /**
  174. * Opacity of disabled components, from 0 to 1. Not all components have reduced opacity when disabled, such as Labels.
  175. *
  176. * @group style
  177. * @type number
  178. */
  179. $v-disabled-opacity: 0.5 !default;
  180. /**
  181. * Color for indicating selection in selection components.
  182. *
  183. * @group color
  184. * @type color
  185. */
  186. $v-selection-color: $v-focus-color !default;
  187. /**
  188. * Color of the component error indicator and other error indications, such as the
  189. * error style notification.
  190. *
  191. * @group color
  192. * @type color
  193. */
  194. $v-error-indicator-color: #ed473b !default;
  195. /**
  196. * Color of the required indicator in field components.
  197. *
  198. * @group color
  199. * @type color
  200. */
  201. $v-required-field-indicator-color: $v-error-indicator-color !default;
  202. /**
  203. * Color used for success states and to indicate safe actions (i.e. actions that
  204. * will not cause any data loss).
  205. *
  206. * @group color
  207. * @type color
  208. */
  209. $v-friendly-color: #2c9720 !default;
  210. /**
  211. * Color specifications for $v-border, $v-bevel, and $v-shadow may use, in addition to CSS colors, the following keywords:
  212. *
  213. * - __v-tint__ - Lighter than the background color
  214. * - __v-shade__ - Darker than the background color
  215. * - __v-tone__ - Adaptive color specification: darker on light background and lighter on dark background. Not usable in $v-shadow.
  216. *
  217. *
  218. * These keywords can be further adjusted by combining them with a strength multiplier, specified in parenthesis.
  219. *
  220. * Examples:
  221. *
  222. * (v-tint 2)
  223. * (v-shade 0.6)
  224. * (v-tone 1.1)
  225. *
  226. * @group color
  227. */
  228. $v-color-keywords: v-tint, v-shade, v-tone;
  229. /**
  230. * This is the base size for various layout measures. It is directly used in some
  231. * measures, such as button height and layout margins, while other measures are
  232. * derived from it. The value must be specified in pixels, with a suitable range
  233. * of 18-50.
  234. *
  235. * @group layout
  236. * @type size (px)
  237. */
  238. $v-unit-size: round(2.3 * $v-font-size) !default;
  239. /**
  240. * Scaling factor for tiny sizes. Must be a unitless number.
  241. *
  242. * @group layout
  243. * @type number
  244. */
  245. $v-scaling-factor--tiny: 0.75 !default;
  246. /**
  247. * Scaling factor for small sizes. Must be a unitless number.
  248. *
  249. * @group layout
  250. * @type number
  251. */
  252. $v-scaling-factor--small: 0.85 !default;
  253. /**
  254. * Scaling factor for large sizes. Must be a unitless number.
  255. *
  256. * @group layout
  257. * @type number
  258. */
  259. $v-scaling-factor--large: 1.2 !default;
  260. /**
  261. * Scaling factor for huge sizes. Must be a unitless number.
  262. *
  263. * @group layout
  264. * @type number
  265. */
  266. $v-scaling-factor--huge: 1.6 !default;
  267. /**
  268. * Unit size for tiny components. Must be a pixel value.
  269. *
  270. * @group layout
  271. * @type size (px)
  272. */
  273. $v-unit-size--tiny: round($v-unit-size * $v-scaling-factor--tiny) !default;
  274. /**
  275. * Unit size for small components. Must be a pixel value.
  276. *
  277. * @group layout
  278. * @type size (px)
  279. */
  280. $v-unit-size--small: round($v-unit-size * $v-scaling-factor--small) !default;
  281. /**
  282. * Unit size for large components. Must be a pixel value.
  283. *
  284. * @group layout
  285. * @type size (px)
  286. */
  287. $v-unit-size--large: round($v-unit-size * $v-scaling-factor--large) !default;
  288. /**
  289. * Unit size for huge components. Must be a pixel value.
  290. *
  291. * @group layout
  292. * @type size (px)
  293. */
  294. $v-unit-size--huge: round($v-unit-size * $v-scaling-factor--huge) !default;
  295. /**
  296. * The top margin size for all built-in layout components, when the margin is
  297. * enabled with setMargin(). Can be any valid CSS size.
  298. *
  299. * @group layout
  300. * @type size
  301. */
  302. $v-layout-margin-top: round($v-unit-size) !default;
  303. /**
  304. * The right margin size for all built-in layout components, when the margin is
  305. * enabled with setMargin(). Can be any valid CSS size.
  306. *
  307. * @group layout
  308. * @type size
  309. */
  310. $v-layout-margin-right: round($v-unit-size) !default;
  311. /**
  312. * The bottom margin size for all built-in layout components, when the margin is
  313. * enabled with setMargin(). Can be any valid CSS size.
  314. *
  315. * @group layout
  316. * @type size
  317. */
  318. $v-layout-margin-bottom: round($v-unit-size) !default;
  319. /**
  320. * The left margin size for all built-in layout components, when the margin is
  321. * enabled with setMargin(). Can be any valid CSS size.
  322. *
  323. * @group layout
  324. * @type size
  325. */
  326. $v-layout-margin-left: round($v-unit-size) !default;
  327. /**
  328. * Amount of vertical space when spacing is enabled for a layout with setSpacing().
  329. * Can be any valid CSS size.
  330. *
  331. * @group layout
  332. * @type size
  333. */
  334. $v-layout-spacing-vertical: round($v-unit-size/3) !default;
  335. /**
  336. * Amount of horizontal space when spacing is enabled for a layout with setSpacing().
  337. * Can be any valid CSS size.
  338. *
  339. * @group layout
  340. * @type size
  341. */
  342. $v-layout-spacing-horizontal: round($v-unit-size/3) !default;
  343. /**
  344. * Tiny font size.
  345. *
  346. * @group typography
  347. * @type size (px)
  348. */
  349. $v-font-size--tiny: ceil($v-font-size * $v-scaling-factor--tiny) !default;
  350. /**
  351. * Small font size.
  352. *
  353. * @group typography
  354. * @type size (px)
  355. */
  356. $v-font-size--small: ceil($v-font-size * $v-scaling-factor--small) !default;
  357. /**
  358. * Large font size.
  359. *
  360. * @group typography
  361. * @type size (px)
  362. */
  363. $v-font-size--large: ceil($v-font-size * $v-scaling-factor--large) !default;
  364. /**
  365. * Huge font size.
  366. *
  367. * @group typography
  368. * @type size (px)
  369. */
  370. $v-font-size--huge: ceil($v-font-size * $v-scaling-factor--huge) !default;
  371. /**
  372. * Default width of certain field components, unless overridden with setWidth().
  373. *
  374. * @group layout
  375. * @type size (px)
  376. */
  377. $v-default-field-width: $v-unit-size * 5 !default;
  378. /**
  379. * Specifies whether various CSS animations are used. Not all animations are disabled when
  380. * set to false, such as the default loading indicator animations.
  381. *
  382. * @group optimization
  383. * @type bool
  384. */
  385. $v-animations-enabled: true !default;
  386. /**
  387. * Specifies whether various :hover styles are used for indicating that mouse pointer
  388. * hovers over an element.
  389. *
  390. * @group optimization
  391. * @type bool
  392. */
  393. $v-hover-styles-enabled: true !default;
  394. /**
  395. * List of components to include in the theme compilation. The list can be modified to make
  396. * the compiled theme smaller by removing unused components from the list.
  397. *
  398. * @group optimization
  399. * @type list
  400. *
  401. * @example scss
  402. * // Remove the Calendar component styles from the output (must be declared after importing Valo)
  403. * $v-included-components: remove($v-included-components, calendar);
  404. *
  405. * @example scss
  406. * // Only include the Label, Button and Vertical and Horizontal layouts in the compilation
  407. * $v-included-components: label, button, orderedlayout;
  408. */
  409. $v-included-components:
  410. absolutelayout,
  411. accordion,
  412. button,
  413. calendar,
  414. checkbox,
  415. colorpicker,
  416. combobox,
  417. csslayout,
  418. customcomponent,
  419. customlayout,
  420. datefield,
  421. dragwrapper,
  422. form,
  423. formlayout,
  424. grid,
  425. gridlayout,
  426. label,
  427. link,
  428. menubar,
  429. nativebutton,
  430. nativeselect,
  431. notification,
  432. optiongroup,
  433. orderedlayout,
  434. panel,
  435. popupview,
  436. progressbar,
  437. slider,
  438. splitpanel,
  439. table,
  440. tabsheet,
  441. textfield,
  442. textarea,
  443. richtextarea,
  444. tree,
  445. tree8,
  446. treegrid,
  447. treetable,
  448. twincolselect,
  449. upload,
  450. window,
  451. valo-menu !default;
  452. /**
  453. * List of components whose additional styles should be included in the compilation.
  454. *
  455. * @group optimization
  456. * @type list
  457. */
  458. $v-included-additional-styles: $v-included-components !default;
  459. /**
  460. * Checks if a given component is included in the compilation. Used by the collection mixins that
  461. * include all components (i.e. valo-components).
  462. *
  463. * @requires $v-included-components
  464. *
  465. * @example scss
  466. * @if v-is-included(button) {
  467. * // The Button component is included in the compilation
  468. * }
  469. *
  470. * @param {string} $component-name - the name of the component to check
  471. * @param {list} $is-included ($v-included-components) - the list of components which is checked
  472. *
  473. * @return {bool} true if the component is included in the compilation, false if not
  474. *
  475. * @group optimization
  476. */
  477. @function v-is-included ($component-name, $is-included: $v-included-components) {
  478. @return contains($is-included, $component-name);
  479. }
  480. /**
  481. * A flag to note whether relative URL paths are relative to the currently parsed SCSS file or to the compilation root file.
  482. * The Vaadin compiler parses URL paths differently than the regular Sass compiler (i.e. Vaadin modifies relative url paths).
  483. * This boolean is used to flag which compiler is used, so that paths are correct for different resources.
  484. * false == Ruby, true == Vaadin
  485. *
  486. * @type bool
  487. */
  488. $v-relative-paths: true !default;