Ohm-Management - Projektarbeit B-ME
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.

form.sass 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602
  1. $input-color: $grey-darker !default
  2. $input-background-color: $white !default
  3. $input-border-color: $grey-lighter !default
  4. $input-height: $control-height !default
  5. $input-shadow: inset 0 1px 2px rgba($black, 0.1) !default
  6. $input-placeholder-color: rgba($input-color, 0.3) !default
  7. $input-hover-color: $grey-darker !default
  8. $input-hover-border-color: $grey-light !default
  9. $input-focus-color: $grey-darker !default
  10. $input-focus-border-color: $link !default
  11. $input-focus-box-shadow-size: 0 0 0 0.125em !default
  12. $input-focus-box-shadow-color: rgba($link, 0.25) !default
  13. $input-disabled-color: $text-light !default
  14. $input-disabled-background-color: $background !default
  15. $input-disabled-border-color: $background !default
  16. $input-disabled-placeholder-color: rgba($input-disabled-color, 0.3) !default
  17. $input-arrow: $link !default
  18. $input-icon-color: $grey-lighter !default
  19. $input-icon-active-color: $grey !default
  20. $input-radius: $radius !default
  21. $file-border-color: $border !default
  22. $file-radius: $radius !default
  23. $file-cta-background-color: $white-ter !default
  24. $file-cta-color: $grey-dark !default
  25. $file-cta-hover-color: $grey-darker !default
  26. $file-cta-active-color: $grey-darker !default
  27. $file-name-border-color: $border !default
  28. $file-name-border-style: solid !default
  29. $file-name-border-width: 1px 1px 1px 0 !default
  30. $file-name-max-width: 16em !default
  31. $label-color: $grey-darker !default
  32. $label-weight: $weight-bold !default
  33. $help-size: $size-small !default
  34. =input
  35. @extend %control
  36. background-color: $input-background-color
  37. border-color: $input-border-color
  38. color: $input-color
  39. +placeholder
  40. color: $input-placeholder-color
  41. &:hover,
  42. &.is-hovered
  43. border-color: $input-hover-border-color
  44. &:focus,
  45. &.is-focused,
  46. &:active,
  47. &.is-active
  48. border-color: $input-focus-border-color
  49. box-shadow: $input-focus-box-shadow-size $input-focus-box-shadow-color
  50. &[disabled],
  51. fieldset[disabled] &
  52. background-color: $input-disabled-background-color
  53. border-color: $input-disabled-border-color
  54. box-shadow: none
  55. color: $input-disabled-color
  56. +placeholder
  57. color: $input-disabled-placeholder-color
  58. .input,
  59. .textarea
  60. +input
  61. box-shadow: $input-shadow
  62. max-width: 100%
  63. width: 100%
  64. &[readonly]
  65. box-shadow: none
  66. // Colors
  67. @each $name, $pair in $colors
  68. $color: nth($pair, 1)
  69. &.is-#{$name}
  70. border-color: $color
  71. &:focus,
  72. &.is-focused,
  73. &:active,
  74. &.is-active
  75. box-shadow: $input-focus-box-shadow-size rgba($color, 0.25)
  76. // Sizes
  77. &.is-small
  78. +control-small
  79. &.is-medium
  80. +control-medium
  81. &.is-large
  82. +control-large
  83. // Modifiers
  84. &.is-fullwidth
  85. display: block
  86. width: 100%
  87. &.is-inline
  88. display: inline
  89. width: auto
  90. .input
  91. &.is-rounded
  92. border-radius: $radius-rounded
  93. padding-left: 1em
  94. padding-right: 1em
  95. &.is-static
  96. background-color: transparent
  97. border-color: transparent
  98. box-shadow: none
  99. padding-left: 0
  100. padding-right: 0
  101. .textarea
  102. display: block
  103. max-width: 100%
  104. min-width: 100%
  105. padding: 0.625em
  106. resize: vertical
  107. &:not([rows])
  108. max-height: 600px
  109. min-height: 120px
  110. &[rows]
  111. height: initial
  112. // Modifiers
  113. &.has-fixed-size
  114. resize: none
  115. .checkbox,
  116. .radio
  117. cursor: pointer
  118. display: inline-block
  119. line-height: 1.25
  120. position: relative
  121. input
  122. cursor: pointer
  123. &:hover
  124. color: $input-hover-color
  125. &[disabled],
  126. fieldset[disabled] &
  127. color: $input-disabled-color
  128. cursor: not-allowed
  129. .radio
  130. & + .radio
  131. margin-left: 0.5em
  132. .select
  133. display: inline-block
  134. max-width: 100%
  135. position: relative
  136. vertical-align: top
  137. &:not(.is-multiple)
  138. height: $input-height
  139. &:not(.is-multiple):not(.is-loading)
  140. &::after
  141. @extend %arrow
  142. border-color: $input-arrow
  143. right: 1.125em
  144. z-index: 4
  145. &.is-rounded
  146. select
  147. border-radius: $radius-rounded
  148. padding-left: 1em
  149. select
  150. +input
  151. cursor: pointer
  152. display: block
  153. font-size: 1em
  154. max-width: 100%
  155. outline: none
  156. &::-ms-expand
  157. display: none
  158. &[disabled]:hover,
  159. fieldset[disabled] &:hover
  160. border-color: $input-disabled-border-color
  161. &:not([multiple])
  162. padding-right: 2.5em
  163. &[multiple]
  164. height: auto
  165. padding: 0
  166. option
  167. padding: 0.5em 1em
  168. // States
  169. &:not(.is-multiple):not(.is-loading):hover
  170. &::after
  171. border-color: $input-hover-color
  172. // Colors
  173. @each $name, $pair in $colors
  174. $color: nth($pair, 1)
  175. &.is-#{$name}
  176. &:not(:hover)::after
  177. border-color: $color
  178. select
  179. border-color: $color
  180. &:hover,
  181. &.is-hovered
  182. border-color: darken($color, 5%)
  183. &:focus,
  184. &.is-focused,
  185. &:active,
  186. &.is-active
  187. box-shadow: $input-focus-box-shadow-size rgba($color, 0.25)
  188. // Sizes
  189. &.is-small
  190. +control-small
  191. &.is-medium
  192. +control-medium
  193. &.is-large
  194. +control-large
  195. // Modifiers
  196. &.is-disabled
  197. &::after
  198. border-color: $input-disabled-color
  199. &.is-fullwidth
  200. width: 100%
  201. select
  202. width: 100%
  203. &.is-loading
  204. &::after
  205. @extend %loader
  206. margin-top: 0
  207. position: absolute
  208. right: 0.625em
  209. top: 0.625em
  210. transform: none
  211. &.is-small:after
  212. font-size: $size-small
  213. &.is-medium:after
  214. font-size: $size-medium
  215. &.is-large:after
  216. font-size: $size-large
  217. .file
  218. @extend %unselectable
  219. align-items: stretch
  220. display: flex
  221. justify-content: flex-start
  222. position: relative
  223. // Colors
  224. @each $name, $pair in $colors
  225. $color: nth($pair, 1)
  226. $color-invert: nth($pair, 2)
  227. &.is-#{$name}
  228. .file-cta
  229. background-color: $color
  230. border-color: transparent
  231. color: $color-invert
  232. &:hover,
  233. &.is-hovered
  234. .file-cta
  235. background-color: darken($color, 2.5%)
  236. border-color: transparent
  237. color: $color-invert
  238. &:focus,
  239. &.is-focused
  240. .file-cta
  241. border-color: transparent
  242. box-shadow: 0 0 0.5em rgba($color, 0.25)
  243. color: $color-invert
  244. &:active,
  245. &.is-active
  246. .file-cta
  247. background-color: darken($color, 5%)
  248. border-color: transparent
  249. color: $color-invert
  250. // Sizes
  251. &.is-small
  252. font-size: $size-small
  253. &.is-medium
  254. font-size: $size-medium
  255. .file-icon
  256. .fa
  257. font-size: 21px
  258. &.is-large
  259. font-size: $size-large
  260. .file-icon
  261. .fa
  262. font-size: 28px
  263. // Modifiers
  264. &.has-name
  265. .file-cta
  266. border-bottom-right-radius: 0
  267. border-top-right-radius: 0
  268. .file-name
  269. border-bottom-left-radius: 0
  270. border-top-left-radius: 0
  271. &.is-empty
  272. .file-cta
  273. border-radius: $file-radius
  274. .file-name
  275. display: none
  276. &.is-boxed
  277. .file-label
  278. flex-direction: column
  279. .file-cta
  280. flex-direction: column
  281. height: auto
  282. padding: 1em 3em
  283. .file-name
  284. border-width: 0 1px 1px
  285. .file-icon
  286. height: 1.5em
  287. width: 1.5em
  288. .fa
  289. font-size: 21px
  290. &.is-small
  291. .file-icon .fa
  292. font-size: 14px
  293. &.is-medium
  294. .file-icon .fa
  295. font-size: 28px
  296. &.is-large
  297. .file-icon .fa
  298. font-size: 35px
  299. &.has-name
  300. .file-cta
  301. border-radius: $file-radius $file-radius 0 0
  302. .file-name
  303. border-radius: 0 0 $file-radius $file-radius
  304. border-width: 0 1px 1px
  305. &.is-centered
  306. justify-content: center
  307. &.is-fullwidth
  308. .file-label
  309. width: 100%
  310. .file-name
  311. flex-grow: 1
  312. max-width: none
  313. &.is-right
  314. justify-content: flex-end
  315. .file-cta
  316. border-radius: 0 $file-radius $file-radius 0
  317. .file-name
  318. border-radius: $file-radius 0 0 $file-radius
  319. border-width: 1px 0 1px 1px
  320. order: -1
  321. .file-label
  322. align-items: stretch
  323. display: flex
  324. cursor: pointer
  325. justify-content: flex-start
  326. overflow: hidden
  327. position: relative
  328. &:hover
  329. .file-cta
  330. background-color: darken($file-cta-background-color, 2.5%)
  331. color: $file-cta-hover-color
  332. .file-name
  333. border-color: darken($file-name-border-color, 2.5%)
  334. &:active
  335. .file-cta
  336. background-color: darken($file-cta-background-color, 5%)
  337. color: $file-cta-active-color
  338. .file-name
  339. border-color: darken($file-name-border-color, 5%)
  340. .file-input
  341. height: 100%
  342. left: 0
  343. opacity: 0
  344. outline: none
  345. position: absolute
  346. top: 0
  347. width: 100%
  348. .file-cta,
  349. .file-name
  350. @extend %control
  351. border-color: $file-border-color
  352. border-radius: $file-radius
  353. font-size: 1em
  354. padding-left: 1em
  355. padding-right: 1em
  356. white-space: nowrap
  357. .file-cta
  358. background-color: $file-cta-background-color
  359. color: $file-cta-color
  360. .file-name
  361. border-color: $file-name-border-color
  362. border-style: $file-name-border-style
  363. border-width: $file-name-border-width
  364. display: block
  365. max-width: $file-name-max-width
  366. overflow: hidden
  367. text-align: left
  368. text-overflow: ellipsis
  369. .file-icon
  370. align-items: center
  371. display: flex
  372. height: 1em
  373. justify-content: center
  374. margin-right: 0.5em
  375. width: 1em
  376. .fa
  377. font-size: 14px
  378. .label
  379. color: $label-color
  380. display: block
  381. font-size: $size-normal
  382. font-weight: $label-weight
  383. &:not(:last-child)
  384. margin-bottom: 0.5em
  385. // Sizes
  386. &.is-small
  387. font-size: $size-small
  388. &.is-medium
  389. font-size: $size-medium
  390. &.is-large
  391. font-size: $size-large
  392. .help
  393. display: block
  394. font-size: $help-size
  395. margin-top: 0.25rem
  396. @each $name, $pair in $colors
  397. $color: nth($pair, 1)
  398. &.is-#{$name}
  399. color: $color
  400. // Containers
  401. .field
  402. &:not(:last-child)
  403. margin-bottom: 0.75rem
  404. // Modifiers
  405. &.has-addons
  406. display: flex
  407. justify-content: flex-start
  408. .control
  409. &:not(:last-child)
  410. margin-right: -1px
  411. &:not(:first-child):not(:last-child)
  412. .button,
  413. .input,
  414. .select select
  415. border-radius: 0
  416. &:first-child:not(:only-child)
  417. .button,
  418. .input,
  419. .select select
  420. border-bottom-right-radius: 0
  421. border-top-right-radius: 0
  422. &:last-child:not(:only-child)
  423. .button,
  424. .input,
  425. .select select
  426. border-bottom-left-radius: 0
  427. border-top-left-radius: 0
  428. .button,
  429. .input,
  430. .select select
  431. &:not([disabled])
  432. &:hover,
  433. &.is-hovered
  434. z-index: 2
  435. &:focus,
  436. &.is-focused,
  437. &:active,
  438. &.is-active
  439. z-index: 3
  440. &:hover
  441. z-index: 4
  442. &.is-expanded
  443. flex-grow: 1
  444. &.has-addons-centered
  445. justify-content: center
  446. &.has-addons-right
  447. justify-content: flex-end
  448. &.has-addons-fullwidth
  449. .control
  450. flex-grow: 1
  451. flex-shrink: 0
  452. &.is-grouped
  453. display: flex
  454. justify-content: flex-start
  455. & > .control
  456. flex-shrink: 0
  457. &:not(:last-child)
  458. margin-bottom: 0
  459. margin-right: 0.75rem
  460. &.is-expanded
  461. flex-grow: 1
  462. flex-shrink: 1
  463. &.is-grouped-centered
  464. justify-content: center
  465. &.is-grouped-right
  466. justify-content: flex-end
  467. &.is-grouped-multiline
  468. flex-wrap: wrap
  469. & > .control
  470. &:last-child,
  471. &:not(:last-child)
  472. margin-bottom: 0.75rem
  473. &:last-child
  474. margin-bottom: -0.75rem
  475. &:not(:last-child)
  476. margin-bottom: 0
  477. &.is-horizontal
  478. +tablet
  479. display: flex
  480. .field-label
  481. .label
  482. font-size: inherit
  483. +mobile
  484. margin-bottom: 0.5rem
  485. +tablet
  486. flex-basis: 0
  487. flex-grow: 1
  488. flex-shrink: 0
  489. margin-right: 1.5rem
  490. text-align: right
  491. &.is-small
  492. font-size: $size-small
  493. padding-top: 0.375em
  494. &.is-normal
  495. padding-top: 0.375em
  496. &.is-medium
  497. font-size: $size-medium
  498. padding-top: 0.375em
  499. &.is-large
  500. font-size: $size-large
  501. padding-top: 0.375em
  502. .field-body
  503. .field .field
  504. margin-bottom: 0
  505. +tablet
  506. display: flex
  507. flex-basis: 0
  508. flex-grow: 5
  509. flex-shrink: 1
  510. .field
  511. margin-bottom: 0
  512. & > .field
  513. flex-shrink: 1
  514. &:not(.is-narrow)
  515. flex-grow: 1
  516. &:not(:last-child)
  517. margin-right: 0.75rem
  518. .control
  519. box-sizing: border-box
  520. clear: both //fixes the icon floating out of the input when help text is floated right
  521. font-size: $size-normal
  522. position: relative
  523. text-align: left
  524. // Modifiers
  525. &.has-icons-left,
  526. &.has-icons-right
  527. .input,
  528. .select
  529. &:focus
  530. & ~ .icon
  531. color: $input-icon-active-color
  532. &.is-small ~ .icon
  533. font-size: $size-small
  534. &.is-medium ~ .icon
  535. font-size: $size-medium
  536. &.is-large ~ .icon
  537. font-size: $size-large
  538. .icon
  539. color: $input-icon-color
  540. height: $input-height
  541. pointer-events: none
  542. position: absolute
  543. top: 0
  544. width: $input-height
  545. z-index: 4
  546. &.has-icons-left
  547. .input,
  548. .select select
  549. padding-left: $input-height
  550. .icon.is-left
  551. left: 0
  552. &.has-icons-right
  553. .input,
  554. .select select
  555. padding-right: $input-height
  556. .icon.is-right
  557. right: 0
  558. &.is-loading
  559. &::after
  560. @extend %loader
  561. position: absolute !important
  562. right: 0.625em
  563. top: 0.625em
  564. z-index: 4
  565. &.is-small:after
  566. font-size: $size-small
  567. &.is-medium:after
  568. font-size: $size-medium
  569. &.is-large:after
  570. font-size: $size-large