_forms.scss 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974
  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. .nowrap {
  20. white-space: nowrap;
  21. }
  22. .form-description {
  23. p {
  24. padding: 0;
  25. }
  26. }
  27. .button {
  28. @include breakpoint(mobile-only) {
  29. padding: 0.25rem 0.5rem;
  30. }
  31. }
  32. .form-field {
  33. margin-bottom: 1rem;
  34. padding-left: $padding-default;
  35. @include breakpoint(mobile-only) {
  36. padding-left: 1rem;
  37. }
  38. .file-thumbnail-wrapper {
  39. display: inline-block;
  40. position: relative;
  41. }
  42. .file-thumbnail {
  43. max-height: 150px;
  44. vertical-align: top;
  45. display: inline-block;
  46. margin-bottom: 10px;
  47. }
  48. .file-thumbnail-remove {
  49. position: absolute;
  50. text-align: center;
  51. display: block;
  52. top: 3px;
  53. right: 3px;
  54. width: 25px;
  55. height: 25px;
  56. border-radius:100%;
  57. .fa {
  58. font-size: 20px;
  59. line-height: 25px;
  60. vertical-align: top;
  61. }
  62. }
  63. }
  64. .form-data {
  65. padding-right: $padding-default;
  66. @include breakpoint(mobile-only) {
  67. padding-right: 1rem;
  68. }
  69. }
  70. .form-input-addon-wrapper {
  71. display: flex;
  72. .form-input-addon {
  73. display: flex;
  74. padding: 0 5px;
  75. justify-content: center;
  76. align-items: center;
  77. &.copy-to-clipboard {
  78. cursor: pointer;
  79. }
  80. &[data-regenerate] {
  81. cursor: pointer;
  82. }
  83. }
  84. input {
  85. height: 35px;
  86. display: table-cell;
  87. &[name="data[folder]"] {
  88. transition: background-color .5s ease;
  89. }
  90. }
  91. .form-input-prepend {
  92. border-radius: 4px 0 0 4px;
  93. border-right-width: 0 !important;
  94. }
  95. .form-input-append {
  96. border-radius: 0 4px 4px 0;
  97. border-left-width: 0 !important;
  98. }
  99. input:not(:first-child) {
  100. border-top-left-radius: 0;
  101. border-bottom-left-radius: 0;
  102. }
  103. input:not(:last-child) {
  104. border-top-right-radius: 0;
  105. border-bottom-right-radius: 0;
  106. }
  107. }
  108. .overlay {
  109. padding-top: 1rem;
  110. padding-bottom: 1px;
  111. &.bottom {
  112. margin: 2rem auto -2rem auto;
  113. }
  114. }
  115. .required {
  116. display: inline-block;
  117. font-family: helvetica, arial, sans-serif;
  118. vertical-align: middle;
  119. line-height: 0;
  120. font-size: 30px;
  121. margin-left: 0px;
  122. margin-bottom: -5px;
  123. }
  124. label {
  125. padding: 5px 0;
  126. font-weight: 400;
  127. margin:0;
  128. p {
  129. margin: 0;
  130. }
  131. [data-hint] {
  132. display: inline;
  133. }
  134. &.inline {
  135. display: inline;
  136. vertical-align: middle;
  137. margin-right: 15px;
  138. }
  139. &.toggleable {
  140. display: inline;
  141. }
  142. }
  143. .form-sublabel {
  144. p {
  145. opacity: 0.8;
  146. font-size: 0.9rem;
  147. margin: 10px 20px 0 0;
  148. padding: 0;
  149. }
  150. }
  151. input, select, textarea, button, .selectize-input {
  152. font-size: $core-font-size;
  153. line-height: $core-line-height;
  154. border-radius: $form-border-radius;
  155. -webkit-font-smoothing: antialiased;
  156. }
  157. .form-input-file {
  158. position: relative;
  159. min-height: 70px;
  160. border-radius: $form-border-radius;
  161. ul {
  162. margin: 1rem 0;
  163. text-align: left;
  164. font-size: 1rem;
  165. border-radius: $form-border-radius;
  166. }
  167. p {
  168. display: block;
  169. height: 100%;
  170. text-align: center;
  171. margin: 0;
  172. padding: 0.8rem 1rem 0;
  173. font-size: 1.2rem;
  174. }
  175. input {
  176. display: none;
  177. }
  178. }
  179. .selectize-dropdown {
  180. z-index: 100000;
  181. }
  182. // vertical alignment of forms
  183. .grid.vertical {
  184. @include flex-flow(column);
  185. }
  186. // compact
  187. .compact {
  188. .form-field {
  189. margin-bottom: 0.2rem;
  190. }
  191. .form-list-wrapper {
  192. li {
  193. display: flex;
  194. flex-wrap: wrap;
  195. justify-content: flex-start;
  196. .form-field {
  197. width: 50%;
  198. @include breakpoint(mobile-only) {
  199. width: 100%;
  200. }
  201. }
  202. }
  203. }
  204. }
  205. .form-select-wrapper, .selectize-control.single .selectize-input {
  206. position: relative;
  207. &:after {
  208. margin-top: 0;
  209. border: 0;
  210. position: absolute;
  211. content: '\f078';
  212. font-family: 'FontAwesome';
  213. right: 12px;
  214. top: 50%;
  215. line-height: 0;
  216. pointer-events: none;
  217. }
  218. }
  219. .selectize-input {
  220. display: block !important;
  221. box-shadow: none;
  222. padding: $form-select-pad;
  223. margin: 0;
  224. > input {
  225. font-size: $core-font-size;
  226. line-height: $core-line-height;
  227. }
  228. }
  229. .selectize-control.single.plugin-remove_button .selectize-input {
  230. .item, .remove-single {
  231. cursor: pointer;
  232. margin: 0 3px 3px 0;
  233. padding: 2px 6px;
  234. display: inline-block;
  235. border-radius: 2px 0 0 2px !important;
  236. }
  237. .remove-single {
  238. border-radius: 0 2px 2px 0 !important;
  239. margin-left: -2px;
  240. }
  241. }
  242. .selectize-control.single.plugin-remove_button .selectize-input,
  243. .selectize-control.multi .selectize-input {
  244. padding: ($leading-margin / 4) ($leading-margin / 4);
  245. &.has-items {
  246. padding-top: 6px;
  247. padding-bottom: 4px;
  248. }
  249. .item, .remove-single {
  250. border-radius: 2px;
  251. line-height: 1.5;
  252. }
  253. .item > img {
  254. max-height: 20px !important;
  255. max-width: inherit !important;
  256. }
  257. }
  258. .selectize-control.single .selectize-input {
  259. &:after {
  260. right: 27px;
  261. }
  262. &.dropdown-active {
  263. &:after {
  264. content: '\f077';
  265. }
  266. }
  267. }
  268. .x-small {
  269. max-width: 5rem !important;
  270. &.form-input-addon-wrapper {
  271. max-width: inherit !important;
  272. input {
  273. max-width: 5rem !important;
  274. }
  275. }
  276. }
  277. .small {
  278. max-width: 10rem !important;
  279. &.form-input-addon-wrapper {
  280. max-width: inherit !important;
  281. input {
  282. max-width: 10rem !important;
  283. }
  284. }
  285. }
  286. .medium:not(.switch-toggle), .medium.form-input-addon-wrapper input {
  287. max-width: 20rem;
  288. textarea {
  289. height: 7rem;
  290. }
  291. &[data-grav-array-type="container"] {
  292. max-width: 100% !important;
  293. input[type=text] {
  294. width: calc(70% - 110px);
  295. }
  296. }
  297. }
  298. .large, .large.form-input-addon-wrapper input {
  299. max-width: 30rem !important;
  300. textarea {
  301. height: 10rem;
  302. }
  303. &[data-grav-array-type="container"] {
  304. max-width: 100% !important;
  305. input[type=text] {
  306. width: calc(100% - 110px);
  307. }
  308. }
  309. }
  310. select {
  311. width: 100%;
  312. -webkit-appearance:none;
  313. -moz-appearance:none;
  314. appearance:none;
  315. padding: $form-select-pad;
  316. cursor: pointer;
  317. margin: 0;
  318. }
  319. input[type=text],
  320. input[type=password],
  321. input[type=email],
  322. input[type=date],
  323. input[type=tel],
  324. input[type=time],
  325. input[type=week],
  326. input[type=month],
  327. input[type=number],
  328. input[type=color],
  329. input[type=url] {
  330. width: 100%;
  331. }
  332. textarea {
  333. width: 100%;
  334. }
  335. .form-frontmatter-wrapper {
  336. border-radius: $form-border-radius;
  337. }
  338. .switch-toggle {
  339. label {
  340. cursor: pointer;
  341. }
  342. a,label {
  343. outline: none !important;
  344. }
  345. }
  346. .dynfields, [data-grav-field="array"], [data-grav-field="multilevel"] {
  347. input[type=text] {
  348. width: 40%;
  349. float: left;
  350. margin: 0 5px 5px 0;
  351. }
  352. .form-row {
  353. display: inline-block;
  354. width: 100%;
  355. margin-right: 0;
  356. max-width: 100% !important;
  357. span {
  358. padding: 0.5rem;
  359. display: inline-block;
  360. line-height: 1.5;
  361. cursor: pointer;
  362. &[data-grav-array-action="sort"] {
  363. float: left;
  364. cursor: move;
  365. }
  366. }
  367. &.array-field-value_only {
  368. width: 100%;
  369. }
  370. }
  371. }
  372. [data-grav-field="multilevel"] input:disabled {
  373. background-color: lightgray;
  374. }
  375. [data-grav-array-type="container"].one-child {
  376. [data-grav-array-action="sort"] {
  377. display: none;
  378. }
  379. }
  380. .button-bar {
  381. margin-top: 1rem;
  382. padding: 1.2rem 3rem;
  383. width: 100%;
  384. border-bottom-left-radius: 5px;
  385. border-bottom-right-radius: 5px;
  386. }
  387. .checkboxes {
  388. display: inline-block;
  389. padding: 5px 0;
  390. -webkit-touch-callout: none;
  391. -webkit-user-select: none;
  392. -moz-user-select: none;
  393. -ms-user-select: none;
  394. user-select: none;
  395. label {
  396. display: inline;
  397. cursor: pointer;
  398. position: relative;
  399. padding: 0 0 0 2rem;
  400. margin-right: 15px;
  401. }
  402. label:before {
  403. content:"";
  404. display: inline-block;
  405. width: 1.5rem;
  406. height: 1.5rem;
  407. top: 50%;
  408. left: 0;
  409. margin-top: -0.75rem;
  410. margin-right: 10px;
  411. position: absolute;
  412. border-radius: $form-border-radius;
  413. }
  414. input[type=checkbox] {
  415. display: none;
  416. }
  417. input[type=checkbox]:checked + label:before {
  418. content:"\f00c";
  419. font-family: "FontAwesome", sans-serif;
  420. font-size: 1.2rem;
  421. line-height: 1;
  422. text-align: center;
  423. }
  424. &.toggleable label{
  425. margin-right: 0;
  426. }
  427. }
  428. }
  429. // Display
  430. .form-display-wrapper {
  431. p {
  432. padding-left: 0;
  433. padding-right: 0;
  434. &:first-child {
  435. margin-top: 0;
  436. }
  437. }
  438. }
  439. // Frontmatter Field
  440. div.frontmatter {
  441. margin-bottom: 3rem;
  442. }
  443. // parents
  444. [data-grav-field="parents"] {
  445. .form-input-wrapper {
  446. cursor: pointer;
  447. i {
  448. margin-right: .25rem;
  449. }
  450. }
  451. }
  452. [data-remodal-id].parents-container {
  453. form {
  454. overflow: hidden;
  455. }
  456. form > h1 {
  457. margin-bottom: 0;
  458. border-bottom: 1px solid #eee;
  459. }
  460. form > .button-bar {
  461. margin-top: 0;
  462. }
  463. .fjs-list {
  464. overflow: auto;
  465. overflow-y: scroll;
  466. max-height: 400px;
  467. min-height: 100%;
  468. }
  469. .fjs-item {
  470. margin-left: 0;
  471. list-style-type: none;
  472. text-align: left;
  473. }
  474. .parents-content:empty {
  475. display: none;
  476. }
  477. }
  478. textarea.frontmatter {
  479. height: 130px !important;
  480. & + .CodeMirror {
  481. height: 130px;
  482. }
  483. }
  484. // parents
  485. [data-grav-field="parents"] {
  486. .form-input-wrapper {
  487. cursor: pointer;
  488. i {
  489. margin-right: .25rem;
  490. }
  491. }
  492. }
  493. [data-remodal-id].parents-container {
  494. form {
  495. overflow: hidden;
  496. }
  497. form > h1 {
  498. margin-bottom: 0;
  499. border-bottom: 1px solid #eee;
  500. }
  501. form > .button-bar {
  502. margin-top: 0;
  503. }
  504. .fjs-list {
  505. overflow: auto;
  506. overflow-y: scroll;
  507. max-height: 400px;
  508. min-height: 100%;
  509. }
  510. .fjs-item {
  511. margin-left: 0;
  512. list-style-type: none;
  513. text-align: left;
  514. }
  515. .parents-content:empty {
  516. display: none;
  517. }
  518. }
  519. // Sortables
  520. .form-order-wrapper {
  521. .notice {
  522. padding: 5px;
  523. }
  524. ul.orderable {
  525. list-style: none;
  526. margin: 0;
  527. padding: 0;
  528. li {
  529. padding: 0.2rem 1rem;
  530. border-radius: $form-border-radius;
  531. margin: 3px 0;
  532. position: relative;
  533. &.drag-handle {
  534. cursor: move;
  535. &::after {
  536. content: '\f0c9';
  537. font-family: FontAwesome;
  538. position: absolute;
  539. right: 10px;
  540. }
  541. }
  542. i {
  543. font-size: 0.8rem;
  544. }
  545. }
  546. }
  547. }
  548. // Sortables
  549. .form-list-wrapper {
  550. ul[data-collection-holder] {
  551. list-style: none;
  552. margin: 0;
  553. padding: 0;
  554. > li {
  555. padding: 1rem;
  556. border-radius: $form-border-radius;
  557. margin: 3px 0;
  558. position: relative;
  559. .item-actions {
  560. position: absolute;
  561. right: 10px;
  562. top: 4px;
  563. .fa {
  564. cursor: pointer;
  565. }
  566. }
  567. &.collection-collapsed {
  568. height: 70px;
  569. overflow: hidden;
  570. @include transform(translateZ(0));
  571. @include breakpoint(mobile-only) {
  572. height: 120px;
  573. }
  574. // Fix for grav-plugin-admin#1928
  575. // overflow: hidden;
  576. > .form-field ~ .form-field {
  577. display: none;
  578. }
  579. // end fix
  580. }
  581. }
  582. &[data-collection-nosort] > li {
  583. cursor: default;
  584. }
  585. }
  586. .collection-actions {
  587. text-align: right;
  588. }
  589. .collection-sort {
  590. position: absolute;
  591. top: 0;
  592. left: 0;
  593. width: 32px;
  594. bottom: 0;
  595. cursor: move;
  596. @include breakpoint(mobile-only) {
  597. width: 20px;
  598. .fa {
  599. font-size: 0.8rem;
  600. }
  601. }
  602. .fa {
  603. position: absolute;
  604. top: 50%;
  605. left: 50%;
  606. transform: translate(-50%, -50%);
  607. }
  608. }
  609. [data-collection-nosort] .collection-sort {
  610. display: none;
  611. }
  612. }
  613. .form-label.block {
  614. position: relative;
  615. &:hover {
  616. z-index: 2;
  617. }
  618. label {
  619. z-index: 2;
  620. }
  621. }
  622. // Fieldset
  623. #admin-main .admin-block h2 {
  624. font-size: 1.25rem;
  625. margin: 0 0 .5rem;
  626. letter-spacing: normal;
  627. }
  628. .form-fieldset {
  629. margin: 1rem 1.5rem;
  630. }
  631. .form-fieldset--label {
  632. label {
  633. display: table;
  634. font-size: 1.25rem;
  635. padding: .5rem 1rem;
  636. width: 100%;
  637. }
  638. h2 {
  639. margin: 0 !important;
  640. }
  641. .actions {
  642. font-size: initial;
  643. display: table-cell;
  644. text-align: right;
  645. vertical-align: middle;
  646. }
  647. & + .form-data {
  648. margin-top: 1rem;
  649. padding: 0;
  650. }
  651. }
  652. .form-fieldset--cursor {
  653. cursor: pointer;
  654. }
  655. .form-fieldset--info {
  656. font-size: small;
  657. }
  658. .form-fieldset > input:checked ~ .form-data,
  659. .form-fieldset--collapsible .open,
  660. .form-fieldset input:checked ~ .form-label .form-fieldset--collapsible .close {
  661. display: block;
  662. }
  663. .form-fieldset > .form-data,
  664. .form-fieldset--collapsible .close,
  665. .form-fieldset input:checked ~ .form-label .form-fieldset--collapsible .open {
  666. display: none;
  667. }
  668. .filepicker-field-image {
  669. width: 30px;
  670. vertical-align: middle;
  671. margin-right: 5px;
  672. }
  673. .filepicker-field-name {
  674. vertical-align: middle;
  675. }
  676. .permissions-container {
  677. .permission-value {
  678. width: 50%;
  679. float: left;
  680. margin: 0 5px 5px 0;
  681. height: 39px;
  682. }
  683. .switch-toggle {
  684. line-height: 37px;
  685. margin: 0 5px 5px 0;
  686. }
  687. .crudp-container {
  688. display: flex;
  689. .checkboxes.toggleable {
  690. display: block;
  691. label {
  692. display: inline-flex;
  693. padding: inherit;
  694. padding-left: 1.5rem;
  695. padding-right: 0.5rem;
  696. font-weight: bold;
  697. border-top-width: 1px;
  698. border-bottom-width: 1px;
  699. border-right-width: 1px;
  700. border-left-width: 0;
  701. border-style: solid;
  702. &:before {
  703. border: none;
  704. background: none;
  705. }
  706. }
  707. & input[type=checkbox] + label:before {
  708. content:"\f023";
  709. font-family: "FontAwesome";
  710. font-size: 0.8rem;
  711. line-height: 1.8;
  712. text-align: center;
  713. }
  714. &[data-_check-status="1"] input[type=checkbox] + label:before {
  715. content:"\f00c";
  716. font-family: "FontAwesome";
  717. }
  718. &[data-_check-status="2"] input[type=checkbox] + label:before {
  719. content:"\f05e";
  720. }
  721. }
  722. & > div:first-child {
  723. .checkboxes.toggleable {
  724. label {
  725. border-left-width: 1px;
  726. border-radius: $form-border-radius 0 0 $form-border-radius;
  727. }
  728. }
  729. }
  730. & > div:last-of-type {
  731. .checkboxes.toggleable {
  732. label {
  733. border-right-width: 1px;
  734. border-radius: 0 $form-border-radius $form-border-radius 0;
  735. }
  736. }
  737. }
  738. }
  739. }
  740. [data-grav-field="cron"] {
  741. display: flex;
  742. align-items: center;
  743. }
  744. .cron-selector {
  745. input {
  746. font-family: $monospace !important;
  747. font-weight: bold !important;
  748. }
  749. }
  750. .cron-install {
  751. margin: 1rem;
  752. padding: 0;
  753. border-radius: 4px;
  754. form & pre {
  755. padding: 1rem;
  756. margin: 0 1.5rem;
  757. line-height: 1;
  758. }
  759. .setup-status {
  760. font-weight: bold;
  761. }
  762. }
  763. .cron-status, .backups-history {
  764. margin-bottom: 4rem;
  765. .cron-at code {
  766. font-size: 120%;
  767. padding: 2px 10px;
  768. border-radius: 2px;
  769. }
  770. .badge {
  771. white-space: nowrap;
  772. }
  773. tr {
  774. &.deleting {
  775. background: #efefef;
  776. color: #bbb;
  777. text-shadow: 0 1px white;
  778. button, .button {
  779. background: #777;
  780. pointer-events: none;
  781. }
  782. }
  783. }
  784. }
  785. form .cron-job-list, form .backups-list {
  786. li {
  787. display: flex;
  788. flex-direction: row;
  789. flex-wrap: wrap;
  790. }
  791. .form-field.grid {
  792. width: calc(50% - 5px);
  793. @include breakpoint(mobile-only) {
  794. width: 100%;
  795. }
  796. }
  797. }