form.css 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457
  1. /* Form */
  2. li > form {
  3. display: block;
  4. }
  5. form > div:not(.clear):not(.control) {
  6. min-height: 9rem;
  7. position: relative;
  8. box-sizing: border-box;
  9. }
  10. form > div.compact:not(.clear):not(.control) {
  11. min-height: 0;
  12. }
  13. li > form > div:not(.control) { /* If we put the form in a list */
  14. min-height: 0;
  15. padding-top: 0rem;
  16. top: -1.5rem;
  17. }
  18. form > div > label {
  19. position: absolute;
  20. top: 2rem;
  21. text-overflow: ellipsis;
  22. overflow: hidden;
  23. white-space: nowrap;
  24. max-width: 100%;
  25. left: 0; /* We force the left align */
  26. }
  27. *[dir="rtl"] form > div > label {
  28. right: 0;
  29. }
  30. form > div.icon {
  31. padding-left: 9rem;
  32. }
  33. form > div > textarea,
  34. #hiddendiv {
  35. border: none;
  36. resize: none;
  37. font-family: sans-serif;
  38. line-height: 3rem;
  39. box-sizing: border-box;
  40. }
  41. form > div > .select:after {
  42. font-family: "Material-Design-Iconic-Font";
  43. content: "\f2f2";
  44. display: block;
  45. font-size: 4rem;
  46. color: #999;
  47. position: absolute;
  48. right: 1.25rem;
  49. bottom: 0.25rem;
  50. pointer-events: none;
  51. }
  52. *[dir="rtl"] form > div > .select::after {
  53. left: 1.25rem;
  54. right: auto;
  55. }
  56. form > div > .select:hover:after {
  57. color: #555;
  58. }
  59. form > div > .select select {
  60. -webkit-appearance: none;
  61. -moz-appearance: none;
  62. appearance: none;
  63. width: 100%;
  64. background-color: transparent;
  65. background-image: none;
  66. padding: 0.75rem 0;
  67. }
  68. main > header form > div:not(.clear):not(.control) {
  69. min-height: 0;
  70. }
  71. main > header li > form > div:not(.clear):not(.control) {
  72. top: 1rem;
  73. }
  74. main > header form > div:not(.clear):not(.control) > input,
  75. main > header form > div:not(.clear):not(.control) > .select {
  76. padding-top: 0;
  77. }
  78. main > header form > div:not(.clear):not(.control) > .select option {
  79. background-color: white;
  80. color: initial;
  81. }
  82. main > header form > div:not(.clear):not(.control) > input,
  83. main > header form > div:not(.clear):not(.control) > .select:after,
  84. main > header form > div:not(.clear):not(.control) > .select select {
  85. color: white;
  86. }
  87. /* Placeholders to mimic FF */
  88. ::-webkit-input-placeholder, /* WebKit browsers */
  89. :-ms-input-placeholder { /* Internet Explorer 10+ */
  90. color: #fff;
  91. opacity: 0.5;
  92. }
  93. /* Webkit weird CSS, sic */
  94. form > div > .select select,
  95. form > div > input:not([type=submit]),
  96. form > div > textarea {
  97. outline-width: 0;
  98. }
  99. form > div > .labeled,
  100. form > div > .select,
  101. form > div > input:not([type=submit]),
  102. form > div > textarea {
  103. display: block;
  104. padding: 1rem 0;
  105. padding-top: 4.5rem;
  106. width: 100%;
  107. background-color: transparent;
  108. margin-bottom: 1rem;
  109. -webkit-appearance: none; /* iOS */
  110. border-radius: 0; /* iOS */
  111. overflow: hidden; /* Fixme */
  112. }
  113. form > div > .select,
  114. form > div > input:not([type=submit]),
  115. form > div > textarea {
  116. box-shadow: 0px 1px 0px rgba(var(--movim-font), 0.12);
  117. }
  118. form > div > .select {
  119. position: relative;
  120. padding-top: 4rem;
  121. padding-bottom: 0;
  122. }
  123. form > div.compact > .select,
  124. form > div.compact > input:not([type=submit]),
  125. form > div.compact > textarea {
  126. padding-top: 2.5rem;
  127. }
  128. /* Webkit hack */
  129. form > div > input:not([type=submit]):-webkit-autofill {
  130. -webkit-box-shadow: 0 0 0 50px white inset;
  131. }
  132. form > div > input:not([type=submit]):-webkit-autofill:focus {
  133. box-shadow: 0;
  134. -webkit-text-fill-color: #333;
  135. }
  136. /* Checkbox element */
  137. form > div .checkbox > input[type="checkbox"],
  138. form > div .radio > input[type="radio"] {
  139. display: none;
  140. }
  141. form > div .checkbox {
  142. position: relative;
  143. width: 4.5rem;
  144. height: 5rem;
  145. margin-top: calc(50% - 0.9rem);
  146. direction: ltr;
  147. }
  148. form > div .checkbox:before,
  149. form > div .checkbox:after {
  150. content: '';
  151. display: block;
  152. position: absolute;
  153. height: 2.25rem;
  154. width: 2.25rem;
  155. }
  156. form > div .checkbox:before {
  157. border-radius: 2rem 0 0 2rem;
  158. }
  159. form > div .checkbox:after {
  160. border-radius: 0 2rem 2rem 0;
  161. background-color: rgba(var(--movim-font), 0.25);
  162. right: 0;
  163. top: 0;
  164. }
  165. form > div .checkbox > input[type="checkbox"] + label {
  166. z-index: 1;
  167. display: block;
  168. background-color: #FAFAFA;
  169. box-shadow: 0 0.2rem 0.5rem rgba(0, 0, 0, 0.5);
  170. width: 3rem;
  171. height: 3rem;
  172. border-radius: 2rem;
  173. top: -0.4rem;
  174. left: -0.2rem;
  175. position: relative;
  176. font-size: 2rem;
  177. text-align: center;
  178. transition: left 0.3s ease, box-shadow 0.1s ease;
  179. }
  180. form > div .checkbox > input[type="checkbox"] + label:hover,
  181. form > div .checkbox > input[type="checkbox"]:checked + label:hover {
  182. cursor: pointer;
  183. box-shadow: 0 0 0 1.75rem rgba(0, 0, 0, 0.05), 0 0.2rem 0.5rem rgba(0, 0, 0, 0.5);
  184. }
  185. form > div .checkbox > input[type="checkbox"]:checked + label {
  186. background-color: #009587;
  187. left: 0.8em;
  188. }
  189. /* Radio */
  190. form > div .radio > input[type="radio"] + label {
  191. display: inline-block;
  192. width: 2rem;
  193. height: 2rem;
  194. border-radius: 2rem;
  195. border-width: 2px;
  196. border-style: solid;
  197. border-color: gray;
  198. transition: box-shadow 0.1s ease;
  199. margin: 1.25rem;
  200. margin-bottom: 0;
  201. }
  202. form > div .radio > input[type="radio"] + label:hover {
  203. cursor: pointer;
  204. background-color: rgba(var(--movim-font), 0.1);
  205. box-shadow: 0 0 0 1.5rem rgba(var(--movim-font), 0.1);
  206. }
  207. form > div .radio > input[type="radio"]:checked + label {
  208. background-color: blue;
  209. background-color: #009688;
  210. border-color: #009688;
  211. box-shadow: inset 0 0 0 0.4rem rgb(var(--movim-background-main));
  212. }
  213. form > div .radio > input[type="radio"]:checked + label:hover {
  214. box-shadow: inset 0 0 0rem 0.4rem rgb(var(--movim-background-main)), 0 0 0 1.5rem rgba(var(--movim-font), 0.1);
  215. }
  216. /* Disabled */
  217. form > div > input:disabled,
  218. form > div > input:disabled + label {
  219. opacity: 0.5;
  220. }
  221. /* Button */
  222. .button.oppose {
  223. float: right;
  224. }
  225. .button:disabled,
  226. .button.inactive {
  227. opacity: 0.5;
  228. pointer-events:none;
  229. }
  230. .button,
  231. input[type=button] {
  232. -webkit-appearance:none; /* iOS */
  233. min-width: 5rem; /* 8rem ? */
  234. text-align: center;
  235. display: inline-block;
  236. box-sizing: border-box;
  237. text-transform: uppercase;
  238. font-size: 2rem;
  239. font-weight: 700;
  240. line-height: 4.5rem;
  241. height: 4.5rem;
  242. margin: 0.75rem 0.5rem;
  243. border-radius: 0.25rem;
  244. padding: 0 1rem;
  245. border: 0;
  246. transition: background 0.3s ease, box-shadow 0.3s ease;
  247. box-shadow: 0 0.1rem 0.3rem rgba(0, 0, 0, 0.5);
  248. background-image: none;
  249. }
  250. .button:not(.color),
  251. input[type=button]:not(.color) {
  252. background-color: white;
  253. }
  254. .button:active {
  255. box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.23), 0 0.5rem 1.25rem rgba(0, 0, 0, 0.16);
  256. }
  257. .button.flat,
  258. input[type=button].flat {
  259. box-shadow: none;
  260. background-color: transparent;
  261. border: 0;
  262. }
  263. .button:hover,
  264. input[type=button]:hover {
  265. cursor: pointer;
  266. }
  267. .button.flat:hover,
  268. .button.flat.on,
  269. input[type=button].flat:hover {
  270. background-color: rgba(153, 153, 153, 0.2);
  271. }
  272. .button:focus,
  273. input[type=button]:focus {
  274. border: 0;
  275. }
  276. .button.flat:focus,
  277. input[type=button].flat:focus {
  278. background-color: rgba(153, 153, 153, 0.4);
  279. }
  280. .button.action {
  281. position: fixed;
  282. bottom: 2rem;
  283. right: 2rem;
  284. min-height: 0rem;
  285. min-width: 0rem;
  286. line-height: 7rem;
  287. height: 7rem;
  288. width: 7rem;
  289. z-index: 1;
  290. font-size: 3.5rem;
  291. }
  292. .button.action,
  293. .button.action .actions li {
  294. border-radius: 10rem;
  295. box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.23), 0 0.5rem 1.25rem rgba(0, 0, 0, 0.16);
  296. }
  297. .button.action:hover {
  298. background-image: linear-gradient(to bottom, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.1) 100%);
  299. }
  300. .button.action,
  301. .button.action .actions li,
  302. .button.action > i {
  303. transition: all 0.15s ease 0s;
  304. }
  305. .button.action.active > i {
  306. transform: rotate(45deg);
  307. }
  308. li.action div.action .button {
  309. margin: 0.5rem;
  310. display: block;
  311. }
  312. header.big ~ .button.action {
  313. bottom: auto;
  314. position: relative;
  315. float: right;
  316. top: -6rem;
  317. }
  318. @media screen and (min-width: 1025px) {
  319. main > section > div:first-child:nth-last-child(2) .button.action {
  320. right: calc(70% + 3rem);
  321. }
  322. aside ~ * .button.action {
  323. right: calc(50% - 18rem);
  324. }
  325. }
  326. .button.action .actions {
  327. position: absolute;
  328. bottom: 7rem;
  329. left: 0;
  330. padding: 0;
  331. pointer-events: none;
  332. }
  333. .button.action .actions li {
  334. background-color: white;
  335. color: #888;
  336. font-size: 3rem;
  337. line-height: 6rem;
  338. margin: 2rem 0.5rem;
  339. width: 6rem;
  340. height: 6rem;
  341. padding: 0;
  342. opacity: 0;
  343. transition: all 0.3s ease 0.15s;
  344. pointer-events: none;
  345. }
  346. .button.action.active .actions {
  347. pointer-events: auto;
  348. }
  349. .button.action.active .actions li {
  350. opacity: 1;
  351. pointer-events: auto;
  352. }
  353. .button.action .actions li:hover {
  354. background-color: white;
  355. }
  356. .button i {
  357. margin: 0 0.5rem;
  358. }
  359. .button.icon i {
  360. position: relative;
  361. font-size: 2.8rem;
  362. top: 0.3rem;
  363. }
  364. /* The textarea hidden div */
  365. #hiddendiv {
  366. position: fixed;
  367. display: block;
  368. z-index: -1;
  369. opacity: 0;
  370. height: auto;
  371. overflow: hidden;
  372. white-space: pre-wrap;
  373. word-wrap: break-word;
  374. overflow-wrap: break-word; /* future version of deprecated 'word-wrap' */
  375. }