_forms.scss 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674
  1. // Forms
  2. form {
  3. h1, h3, .form-spacer h3 {
  4. padding: 0 $padding-default 0.5rem;
  5. margin: 0 0 1rem;
  6. font-size: 1.5rem;
  7. text-align: left;
  8. letter-spacing: -1px;
  9. }
  10. h3 {
  11. padding-left: 0;
  12. }
  13. p {
  14. padding: 0 $padding-default;
  15. }
  16. pre {
  17. padding: 1.5rem 3rem;
  18. }
  19. .form-description {
  20. p {
  21. padding: 0;
  22. }
  23. }
  24. .form-field {
  25. margin-bottom: 1rem;
  26. padding-left: $padding-default;
  27. @include breakpoint(mobile-only) {
  28. padding-left: 1rem;
  29. }
  30. .file-thumbnail-wrapper {
  31. display: inline-block;
  32. position: relative;
  33. }
  34. .file-thumbnail {
  35. max-height: 150px;
  36. vertical-align: top;
  37. display: inline-block;
  38. margin-bottom: 10px;
  39. }
  40. .file-thumbnail-remove {
  41. position: absolute;
  42. text-align: center;
  43. display: block;
  44. top: 3px;
  45. right: 3px;
  46. width: 25px;
  47. height: 25px;
  48. border-radius:100%;
  49. .fa {
  50. font-size: 20px;
  51. line-height: 25px;
  52. vertical-align: top;
  53. }
  54. }
  55. }
  56. .form-data {
  57. padding-right: $padding-default;
  58. @include breakpoint(mobile-only) {
  59. padding-right: 1rem;
  60. }
  61. }
  62. .form-input-addon-wrapper {
  63. display: table-row;
  64. .form-input-addon {
  65. display: table-cell;
  66. min-width: 43px;
  67. padding: 0 10px;
  68. text-align: center;
  69. }
  70. input {
  71. height: 35px;
  72. display: table-cell;
  73. }
  74. .form-input-prepend {
  75. border-radius: 4px 0 0 4px;
  76. border-right-width: 0 !important;
  77. }
  78. .form-input-append {
  79. border-radius: 0 4px 4px 0;
  80. border-left-width: 0 !important;
  81. }
  82. input:not(:first-child) {
  83. border-top-left-radius: 0;
  84. border-bottom-left-radius: 0;
  85. }
  86. input:not(:last-child) {
  87. border-top-right-radius: 0;
  88. border-bottom-right-radius: 0;
  89. }
  90. }
  91. .overlay {
  92. padding-top: 1rem;
  93. padding-bottom: 1px;
  94. &.bottom {
  95. margin: 2rem auto -2rem auto;
  96. }
  97. }
  98. .required {
  99. font-family: helvetica, arial;
  100. vertical-align: middle;
  101. line-height: 1;
  102. font-size: 30px;
  103. margin-left: 5px;
  104. }
  105. label {
  106. padding: 5px 0;
  107. font-weight: 400;
  108. margin:0;
  109. p {
  110. margin: 0;
  111. }
  112. [data-hint] {
  113. display: inline;
  114. }
  115. &.inline {
  116. display: inline;
  117. vertical-align: middle;
  118. margin-right: 15px;
  119. }
  120. &.toggleable {
  121. display: inline;
  122. }
  123. }
  124. .form-sublabel {
  125. p {
  126. opacity: 0.8;
  127. font-size: 0.9rem;
  128. margin: 10px 20px 0 0;
  129. padding: 0;
  130. }
  131. }
  132. input, select, textarea, button, .selectize-input {
  133. font-size: $core-font-size;
  134. line-height: $core-line-height;
  135. border-radius: $form-border-radius;
  136. -webkit-font-smoothing: antialiased;
  137. }
  138. .form-input-file {
  139. position: relative;
  140. min-height: 70px;
  141. border-radius: $form-border-radius;
  142. ul {
  143. margin: 1rem 0;
  144. text-align: left;
  145. font-size: 1rem;
  146. border-radius: $form-border-radius;
  147. }
  148. p {
  149. display: block;
  150. height: 100%;
  151. text-align: center;
  152. margin: 0;
  153. padding: 0.8rem 1rem 0;
  154. font-size: 1.2rem;
  155. }
  156. input {
  157. display: none;
  158. }
  159. }
  160. .selectize-dropdown {
  161. z-index: 100000;
  162. }
  163. // vertical alignment of forms
  164. .grid.vertical {
  165. @include flex-flow(column);
  166. }
  167. // compact
  168. .compact {
  169. .form-field {
  170. margin-bottom: 0.2rem;
  171. }
  172. .form-list-wrapper {
  173. li {
  174. display: flex;
  175. flex-wrap: wrap;
  176. justify-content: flex-start;
  177. .form-field {
  178. width: 50%;
  179. @include breakpoint(mobile-only) {
  180. width: 100%;
  181. }
  182. }
  183. }
  184. }
  185. }
  186. .form-select-wrapper, .selectize-control.single .selectize-input {
  187. position: relative;
  188. &:after {
  189. margin-top: 0;
  190. border: 0;
  191. position: absolute;
  192. content: '\f078';
  193. font-family: 'FontAwesome';
  194. right: 12px;
  195. top: 50%;
  196. line-height: 0;
  197. pointer-events: none;
  198. }
  199. }
  200. .selectize-input {
  201. display: block !important;
  202. box-shadow: none;
  203. padding: $form-select-pad;
  204. margin: 0;
  205. > input {
  206. font-size: $core-font-size;
  207. line-height: $core-line-height;
  208. }
  209. }
  210. .selectize-control.multi .selectize-input {
  211. padding: ($leading-margin / 4) ($leading-margin / 4);
  212. &.has-items {
  213. padding-top: 6px;
  214. padding-bottom: 4px;
  215. }
  216. > div {
  217. border-radius: 2px;
  218. line-height: 1.5;
  219. }
  220. }
  221. .selectize-control.single .selectize-input {
  222. &:after {
  223. right: 27px;
  224. }
  225. &.dropdown-active {
  226. &:after {
  227. content: '\f077';
  228. }
  229. }
  230. }
  231. .x-small, .x-small.form-input-addon-wrapper input {
  232. max-width: 5rem !important;
  233. }
  234. .small, .small.form-input-addon-wrapper input {
  235. max-width: 10rem !important;
  236. }
  237. .medium, .medium.form-input-addon-wrapper input {
  238. max-width: 20rem;
  239. textarea {
  240. height: 7rem;
  241. }
  242. &[data-grav-array-type="container"] {
  243. max-width: 100% !important;
  244. input[type=text] {
  245. width: calc(70% - 110px);
  246. }
  247. }
  248. }
  249. .large, .large.form-input-addon-wrapper input {
  250. max-width: 30rem !important;
  251. textarea {
  252. height: 10rem;
  253. }
  254. &[data-grav-array-type="container"] {
  255. max-width: 100% !important;
  256. input[type=text] {
  257. width: calc(100% - 110px);
  258. }
  259. }
  260. }
  261. select {
  262. width: 100%;
  263. -webkit-appearance:none;
  264. -moz-appearance:none;
  265. appearance:none;
  266. padding: $form-select-pad;
  267. cursor: pointer;
  268. margin: 0;
  269. }
  270. input[type=text],
  271. input[type=password],
  272. input[type=email],
  273. input[type=date],
  274. input[type=tel],
  275. input[type=time],
  276. input[type=week],
  277. input[type=month],
  278. input[type=number],
  279. input[type=color],
  280. input[type=url] {
  281. width: 100%;
  282. }
  283. textarea {
  284. width: 100%;
  285. }
  286. .form-frontmatter-wrapper {
  287. border-radius: $form-border-radius;
  288. }
  289. .switch-toggle {
  290. // margin-left: 30%;
  291. label {
  292. cursor: pointer;
  293. }
  294. a,label {
  295. outline: none !important;
  296. }
  297. }
  298. .dynfields, [data-grav-field="array"], [data-grav-field="multilevel"] {
  299. input[type=text] {
  300. width: 40%;
  301. float: left;
  302. margin: 0 5px 5px 0;
  303. }
  304. .form-row {
  305. display: inline-block;
  306. width: 100%;
  307. margin-right: 0;
  308. max-width: 100% !important;
  309. span {
  310. padding: 0.5rem;
  311. display: inline-block;
  312. line-height: 1.5;
  313. cursor: pointer;
  314. &[data-grav-array-action="sort"] {
  315. float: left;
  316. cursor: move;
  317. }
  318. }
  319. &.array-field-value_only {
  320. width: 100%;
  321. }
  322. }
  323. }
  324. [data-grav-field="multilevel"] input:disabled {
  325. background-color: lightgray;
  326. }
  327. [data-grav-array-type="container"].one-child {
  328. [data-grav-array-action="sort"] {
  329. display: none;
  330. }
  331. }
  332. .button-bar {
  333. margin-top: 1rem;
  334. padding: 1.2rem 3rem;
  335. width: 100%;
  336. border-bottom-left-radius: 5px;
  337. border-bottom-right-radius: 5px;
  338. }
  339. .checkboxes {
  340. display: inline-block;
  341. padding: 5px 0;
  342. label {
  343. display: inline;
  344. cursor: pointer;
  345. position: relative;
  346. padding: 0 0 0 2rem;
  347. margin-right: 15px;
  348. }
  349. label:before {
  350. content:"";
  351. display: inline-block;
  352. width: 1.5rem;
  353. height: 1.5rem;
  354. top: 50%;
  355. left: 0;
  356. margin-top: -0.75rem;
  357. margin-right: 10px;
  358. position: absolute;
  359. border-radius: $form-border-radius;
  360. }
  361. input[type=checkbox] {
  362. display: none;
  363. }
  364. input[type=checkbox]:checked + label:before {
  365. content:"\f00c";
  366. font-family: "FontAwesome";
  367. font-size: 1.2rem;
  368. line-height: 1;
  369. text-align: center;
  370. }
  371. &.toggleable label{
  372. margin-right: 0;
  373. }
  374. }
  375. }
  376. // Display
  377. .form-display-wrapper {
  378. p {
  379. padding-left: 0;
  380. padding-right: 0;
  381. &:first-child {
  382. margin-top: 0;
  383. }
  384. }
  385. }
  386. // Frontmatter Field
  387. div.frontmatter {
  388. margin-bottom: 3rem;
  389. }
  390. textarea.frontmatter {
  391. height: 130px !important;
  392. & + .CodeMirror {
  393. height: 130px;
  394. }
  395. }
  396. // Sortables
  397. .form-order-wrapper {
  398. .notice {
  399. padding: 5px;
  400. }
  401. ul.orderable {
  402. list-style: none;
  403. margin: 0;
  404. padding: 0;
  405. li {
  406. padding: 0.2rem 1rem;
  407. border-radius: $form-border-radius;
  408. margin: 3px 0;
  409. position: relative;
  410. &.drag-handle {
  411. cursor: move;
  412. &::after {
  413. content: '\f0c9';
  414. font-family: FontAwesome;
  415. position: absolute;
  416. right: 10px;
  417. }
  418. }
  419. i {
  420. font-size: 0.8rem;
  421. }
  422. }
  423. }
  424. }
  425. // Sortables
  426. .form-list-wrapper {
  427. ul[data-collection-holder] {
  428. list-style: none;
  429. margin: 0;
  430. padding: 0;
  431. > li {
  432. padding: 1rem;
  433. border-radius: $form-border-radius;
  434. margin: 3px 0;
  435. position: relative;
  436. .item-actions {
  437. position: absolute;
  438. right: 10px;
  439. top: 4px;
  440. .fa {
  441. cursor: pointer;
  442. }
  443. }
  444. &.collection-collapsed {
  445. height: 70px;
  446. overflow: hidden;
  447. @include transform(translateZ(0));
  448. @include breakpoint(mobile-only) {
  449. height: 120px;
  450. }
  451. }
  452. }
  453. &[data-collection-nosort] > li {
  454. cursor: default;
  455. }
  456. }
  457. .collection-actions {
  458. text-align: right;
  459. }
  460. .collection-sort {
  461. position: absolute;
  462. top: 0;
  463. left: 0;
  464. width: 32px;
  465. bottom: 0;
  466. cursor: move;
  467. @include breakpoint(mobile-only) {
  468. width: 20px;
  469. .fa {
  470. font-size: 0.8rem;
  471. }
  472. }
  473. .fa {
  474. position: absolute;
  475. top: 50%;
  476. left: 50%;
  477. transform: translate(-50%, -50%);
  478. }
  479. }
  480. [data-collection-nosort] .collection-sort {
  481. display: none;
  482. }
  483. }
  484. .form-label.block {
  485. &:hover {
  486. z-index: 2;
  487. }
  488. label {
  489. z-index: 2;
  490. }
  491. }
  492. // Fieldset
  493. #admin-main .admin-block h2 {
  494. font-size: 1.25rem;
  495. margin: 0 0 .5rem;
  496. letter-spacing: normal;
  497. }
  498. .form-fieldset {
  499. margin: 1rem 1.5rem;
  500. }
  501. .form-fieldset--label {
  502. label {
  503. display: table;
  504. font-size: 1.25rem;
  505. padding: .5rem 1rem;
  506. width: 100%;
  507. }
  508. h2 {
  509. margin: 0 !important;
  510. }
  511. .actions {
  512. font-size: initial;
  513. display: table-cell;
  514. text-align: right;
  515. vertical-align: middle;
  516. }
  517. & + .form-data {
  518. margin-top: 1rem;
  519. padding: 0;
  520. }
  521. }
  522. .form-fieldset--cursor {
  523. cursor: pointer;
  524. }
  525. .form-fieldset--info {
  526. font-size: small;
  527. }
  528. .form-fieldset > input:checked ~ .form-data,
  529. .form-fieldset--collapsible .open,
  530. .form-fieldset input:checked ~ .form-label .form-fieldset--collapsible .close {
  531. display: block;
  532. }
  533. .form-fieldset > .form-data,
  534. .form-fieldset--collapsible .close,
  535. .form-fieldset input:checked ~ .form-label .form-fieldset--collapsible .open {
  536. display: none;
  537. }
  538. .filepicker-field-image {
  539. width: 30px;
  540. vertical-align: middle;
  541. margin-right: 5px;
  542. }
  543. .filepicker-field-name {
  544. vertical-align: middle;
  545. }
  546. .permissions-container {
  547. .permission-value {
  548. width: 50%;
  549. float: left;
  550. margin: 0 5px 5px 0;
  551. height: 39px;
  552. }
  553. .switch-toggle {
  554. line-height: 37px;
  555. margin: 0 5px 5px 0;
  556. }
  557. }