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.

_label.scss 6.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  1. /**
  2. * The font weight for headers.
  3. *
  4. * @group label
  5. */
  6. $v-font-weight--header: $v-font-weight - 100 !default;
  7. /**
  8. * The line height for headers.
  9. *
  10. * @group label
  11. */
  12. $v-line-height--header: 1.1 !default;
  13. /**
  14. * The font family for headers.
  15. *
  16. * @group label
  17. */
  18. $v-font-family--header: null !default;
  19. /**
  20. * The font color for colored style labels.
  21. *
  22. * @group label
  23. */
  24. $v-font-color--colored: $v-selection-color !default;
  25. /**
  26. * The font size for 1st level headers.
  27. *
  28. * @group label
  29. */
  30. $v-font-size--h1: 2.4em !default;
  31. /**
  32. * The font size for 2nd level headers.
  33. *
  34. * @group label
  35. */
  36. $v-font-size--h2: 1.6em !default;
  37. /**
  38. * The font size for 3rd level headers.
  39. *
  40. * @group label
  41. */
  42. $v-font-size--h3: 1.2em !default;
  43. /**
  44. * The font family for 1st level headers.
  45. *
  46. * @group label
  47. */
  48. $v-font-family--h1: $v-font-family--header !default;
  49. /**
  50. * The font family for 2nd level headers.
  51. *
  52. * @group label
  53. */
  54. $v-font-family--h2: $v-font-family--header !default;
  55. /**
  56. * The font family for 3rd level headers.
  57. *
  58. * @group label
  59. */
  60. $v-font-family--h3: $v-font-family--header !default;
  61. /**
  62. * The letter spacing for 1st level headers.
  63. *
  64. * @group label
  65. */
  66. $v-letter-spacing--h1: -0.03em !default;
  67. /**
  68. * The letter spacing for 2nd level headers.
  69. *
  70. * @group label
  71. */
  72. $v-letter-spacing--h2: -0.02em !default;
  73. /**
  74. * The letter spacing for 3rd level headers.
  75. *
  76. * @group label
  77. */
  78. $v-letter-spacing--h3: 0 !default;
  79. /**
  80. * The letter spacing for 4th level headers.
  81. *
  82. * @group label
  83. */
  84. $v-letter-spacing--h4: 0 !default;
  85. /**
  86. * Outputs the selectors and styles for the Label component.
  87. *
  88. * @param {string} $primary-stylename (v-label) - the primary style name for the selectors
  89. * @param {bool} $include-additional-styles - should the mixin output all the different style variations of the component
  90. *
  91. * @group label
  92. */
  93. @mixin valo-label ($primary-stylename: v-label, $include-additional-styles: contains($v-included-additional-styles, label)) {
  94. .#{$primary-stylename} {
  95. @include user-select(text);
  96. }
  97. .#{$primary-stylename}-undef-w {
  98. white-space: nowrap;
  99. }
  100. h1, .#{$primary-stylename}-h1,
  101. h2, .#{$primary-stylename}-h2,
  102. h3, .#{$primary-stylename}-h3 {
  103. line-height: $v-line-height--header;
  104. font-weight: $v-font-weight--header;
  105. color: valo-font-color($v-app-background-color, 0.92);
  106. }
  107. h1, .#{$primary-stylename}-h1 {
  108. font-size: $v-font-size--h1;
  109. margin-top: 1.4em;
  110. margin-bottom: 1em;
  111. font-family: $v-font-family--h1;
  112. letter-spacing: $v-letter-spacing--h1;
  113. }
  114. h2, .#{$primary-stylename}-h2 {
  115. font-size: $v-font-size--h2;
  116. font-family: $v-font-family--h2;
  117. margin-top: 1.6em;
  118. margin-bottom: 0.77em;
  119. letter-spacing: $v-letter-spacing--h2;
  120. }
  121. h3, .#{$primary-stylename}-h3 {
  122. font-size: $v-font-size--h3;
  123. font-family: $v-font-family--h3;
  124. margin-top: 1.8em;
  125. margin-bottom: 0.77em;
  126. letter-spacing: $v-letter-spacing--h3;
  127. }
  128. h4, .#{$primary-stylename}-h4 {
  129. line-height: $v-line-height--header;
  130. font-weight: $v-font-weight + 200;
  131. font-size: $v-font-size--small;
  132. color: valo-font-color($v-app-background-color, 0.74);
  133. text-transform: uppercase;
  134. letter-spacing: $v-letter-spacing--h4;
  135. margin-top: 2.4em;
  136. margin-bottom: 0.8em;
  137. }
  138. .v-csslayout {
  139. > h1,
  140. > h2,
  141. > h3,
  142. > h4
  143. > .#{$primary-stylename}-h1,
  144. > .#{$primary-stylename}-h2,
  145. > .#{$primary-stylename}-h3,
  146. > .#{$primary-stylename}-h4 {
  147. &:first-child {
  148. margin-top: $v-font-size;
  149. }
  150. }
  151. }
  152. .v-verticallayout > .v-slot:first-child,
  153. .v-verticallayout > div > .v-slot:first-child {
  154. h1, .#{$primary-stylename}-h1,
  155. h2, .#{$primary-stylename}-h2,
  156. h3, .#{$primary-stylename}-h3,
  157. h4, .#{$primary-stylename}-h4 {
  158. margin-top: $v-font-size;
  159. }
  160. }
  161. .v-verticallayout > .v-slot:first-child .v-formlayout-contentcell,
  162. .v-verticallayout > div > .v-slot:first-child .v-formlayout-contentcell {
  163. h1, .#{$primary-stylename}-h1,
  164. h2, .#{$primary-stylename}-h2,
  165. h3, .#{$primary-stylename}-h3,
  166. h4, .#{$primary-stylename}-h4 {
  167. margin-top: -0.5em;
  168. }
  169. }
  170. h1, .#{$primary-stylename}-h1,
  171. h2, .#{$primary-stylename}-h2,
  172. h3, .#{$primary-stylename}-h3,
  173. h4, .#{$primary-stylename}-h4 {
  174. &.no-margin {
  175. margin: 0 !important;
  176. }
  177. }
  178. @if $include-additional-styles {
  179. .#{$primary-stylename}-colored {
  180. color: $v-font-color--colored;
  181. }
  182. .#{$primary-stylename}-large {
  183. font-size: $v-font-size--large;
  184. }
  185. .#{$primary-stylename}-small {
  186. font-size: $v-font-size--small;
  187. }
  188. .#{$primary-stylename}-tiny {
  189. font-size: $v-font-size--tiny;
  190. }
  191. .#{$primary-stylename}-huge {
  192. font-size: $v-font-size--huge;
  193. }
  194. .#{$primary-stylename}-bold {
  195. font-weight: $v-font-weight + 200;
  196. }
  197. .#{$primary-stylename}-light {
  198. font-weight: $v-font-weight - 100;
  199. @if $v-font-weight < 400 {
  200. color: valo-font-color($v-app-background-color, .5);
  201. }
  202. }
  203. .#{$primary-stylename}-align-right {
  204. text-align: right;
  205. }
  206. .#{$primary-stylename}-align-center {
  207. text-align: center;
  208. }
  209. .#{$primary-stylename}-spinner {
  210. @include valo-spinner;
  211. }
  212. .#{$primary-stylename}-success,
  213. .#{$primary-stylename}-failure {
  214. background: $v-textfield-background-color;
  215. color: valo-font-color($v-textfield-background-color);
  216. border: 2px solid $v-friendly-color;
  217. border-radius: $v-border-radius;
  218. padding: round($v-unit-size/5) round($v-unit-size/2) round($v-unit-size/5) round($v-unit-size);
  219. font-weight: $v-font-weight + 100;
  220. font-size: round($v-font-size * 0.95);
  221. &:before {
  222. font-family: ThemeIcons;
  223. content: "\f00c";
  224. margin-right: .5em;
  225. margin-left: round($v-unit-size/-2);
  226. color: $v-friendly-color;
  227. }
  228. }
  229. .#{$primary-stylename}-failure {
  230. border-color: $v-error-indicator-color;
  231. &:before {
  232. content: "\f05e";
  233. color: $v-error-indicator-color;
  234. }
  235. }
  236. }
  237. }