Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 34 additions & 5 deletions assets/src/css/form-basic.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,42 @@
.mc4wp-form-basic {
margin: 1em 0;
}

.mc4wp-form-basic label,
.mc4wp-form-basic input {
width: auto;
display: block;
box-sizing: border-box;
cursor: auto;
height: auto;
vertical-align: baseline;
line-height: normal;
}

.mc4wp-form-basic label:after,
.mc4wp-form-basic input:after {
content:"";
display:table;
clear:both;
content: "";
display: table;
clear: both;
}

.mc4wp-form-basic label {
font-weight: bold;
margin-bottom: 6px;
display: block;
}

/* OLD STYLE: When input is a sibling (not nested) */
.mc4wp-form-basic label + input {
display: block;
}

/* NEW STYLE: When input is nested inside label */
.mc4wp-form-basic label > input {
display: block;
margin-top: 6px;
font-weight: normal;
}

/* Form Elements */
.mc4wp-form-basic input[type="text"],
.mc4wp-form-basic input[type="email"],
Expand All @@ -38,9 +52,11 @@
width: 100%;
max-width: 480px;
}

.mc4wp-form-basic input[type="number"] {
min-width: 40px;
}

.mc4wp-form-basic input[type="checkbox"],
.mc4wp-form-basic input[type="radio"] {
position: relative;
Expand All @@ -51,16 +67,26 @@
display: inline-block;
border: 0;
}

/* NEW STYLE: Checkbox/radio nested in label - override inline-block */
.mc4wp-form-basic label > input[type="checkbox"],
.mc4wp-form-basic label > input[type="radio"] {
display: inline-block;
margin-top: 0;
}

.mc4wp-form-basic input[type="checkbox"] {
-webkit-appearance: checkbox;
-moz-appearance: checkbox;
appearance: checkbox;
}

.mc4wp-form-basic input[type="radio"] {
-webkit-appearance: radio;
-moz-appearance: radio;
appearance: radio;
}

.mc4wp-form-basic input[type="submit"],
.mc4wp-form-basic button,
.mc4wp-form-basic input[type="button"] {
Expand All @@ -78,16 +104,19 @@
}

/* Alert */
.mc4wp-alert{
.mc4wp-alert {
color: #c09853;
clear: both;
}

.mc4wp-success {
color: #468847;
}

.mc4wp-notice {
color: #3a87ad;
}

.mc4wp-error {
color: #CD5C5C;
}
Expand Down
51 changes: 44 additions & 7 deletions assets/src/css/form-themes.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,42 @@
.mc4wp-form-theme {
margin: 1em 0;
}

.mc4wp-form-theme label,
.mc4wp-form-theme input {
width: auto;
display: block;
box-sizing: border-box;
cursor: auto;
height: auto;
vertical-align: baseline;
line-height: normal;
}

.mc4wp-form-theme label:after,
.mc4wp-form-theme input:after {
content:"";
display:table;
clear:both;
content: "";
display: table;
clear: both;
}

.mc4wp-form-theme label {
font-weight: bold;
margin-bottom: 6px;
display: block;
}

/* OLD STYLE: When input is a sibling (not nested) */
.mc4wp-form-theme label + input {
display: block;
}

/* NEW STYLE: When input is nested inside label */
.mc4wp-form-theme label > input {
display: block;
margin-top: 6px;
font-weight: normal;
}

/* Form Elements */
.mc4wp-form-theme input[type="text"],
.mc4wp-form-theme input[type="email"],
Expand All @@ -49,16 +63,20 @@
text-shadow: none;
outline: 0;
}

.mc4wp-form-theme textarea {
height: auto;
}

.mc4wp-form-theme input[readonly],
.mc4wp-form-theme input[disabled] {
background-color: #eeeeee;
}

.mc4wp-form-theme input[type="number"] {
min-width: 40px;
}

.mc4wp-form-theme input[type="checkbox"],
.mc4wp-form-theme input[type="radio"] {
position: relative;
Expand All @@ -69,11 +87,20 @@
display: inline-block;
border: 0;
}

/* NEW STYLE: Checkbox/radio nested in label - override to keep inline */
.mc4wp-form-theme label > input[type="checkbox"],
.mc4wp-form-theme label > input[type="radio"] {
display: inline-block;
margin-top: 0;
}

.mc4wp-form-theme input[type="checkbox"] {
-webkit-appearance: checkbox;
-moz-appearance: checkbox;
appearance: checkbox;
}

.mc4wp-form-theme input[type="radio"] {
-webkit-appearance: radio;
-moz-appearance: radio;
Expand Down Expand Up @@ -123,16 +150,19 @@
}

/* Alert */
.mc4wp-alert{
.mc4wp-alert {
color: #c09853;
clear: both;
}

.mc4wp-success {
color: #468847;
}

.mc4wp-notice {
color: #3a87ad;
}

.mc4wp-error {
color: #CD5C5C;
}
Expand All @@ -150,6 +180,7 @@
background-color: #444444 !important;
border-color: #1e1e1e;
}

.mc4wp-form-theme-dark button:hover,
.mc4wp-form-theme-dark input[type="submit"]:hover,
.mc4wp-form-theme-dark input[type="button"]:hover,
Expand All @@ -160,6 +191,7 @@
background-color: #1e1e1e !important;
border-color: black;
}

.mc4wp-form-theme-dark input[type="text"]:focus,
.mc4wp-form-theme-dark input[type="email"]:focus,
.mc4wp-form-theme-dark input[type="tel"]:focus,
Expand All @@ -177,6 +209,7 @@
background-color: #ffffff !important;
border-color: #d9d9d9;
}

.mc4wp-form-theme-light button:hover,
.mc4wp-form-theme-light input[type="submit"]:hover,
.mc4wp-form-theme-light input[type="button"]:hover,
Expand All @@ -187,6 +220,7 @@
background-color: #d9d9d9 !important;
border-color: #b3b3b3;
}

.mc4wp-form-theme-light input[type="text"]:focus,
.mc4wp-form-theme-light input[type="email"]:focus,
.mc4wp-form-theme-light input[type="tel"]:focus,
Expand All @@ -204,6 +238,7 @@
background-color: #d9534f !important;
border-color: #b52b27;
}

.mc4wp-form-theme-red button:hover,
.mc4wp-form-theme-red input[type="submit"]:hover,
.mc4wp-form-theme-red input[type="button"]:hover,
Expand All @@ -214,6 +249,7 @@
background-color: #b52b27 !important;
border-color: #761c19;
}

.mc4wp-form-theme-red input[type="text"]:focus,
.mc4wp-form-theme-red input[type="email"]:focus,
.mc4wp-form-theme-red input[type="tel"]:focus,
Expand All @@ -231,6 +267,7 @@
background-color: #428bca !important;
border-color: #2a6496;
}

.mc4wp-form-theme-blue button:hover,
.mc4wp-form-theme-blue input[type="submit"]:hover,
.mc4wp-form-theme-blue input[type="button"]:hover,
Expand All @@ -241,6 +278,7 @@
background-color: #2a6496 !important;
border-color: #193c5a;
}

.mc4wp-form-theme-blue input[type="text"]:focus,
.mc4wp-form-theme-blue input[type="email"]:focus,
.mc4wp-form-theme-blue input[type="tel"]:focus,
Expand Down Expand Up @@ -269,6 +307,7 @@
background-color: #3d8b3d !important;
border-color: #255625;
}

.mc4wp-form-theme-green input[type="text"]:focus,
.mc4wp-form-theme-green input[type="email"]:focus,
.mc4wp-form-theme-green input[type="tel"]:focus,
Expand All @@ -278,5 +317,3 @@
.mc4wp-form-theme-green select:focus {
border-color: #91cf91;
}


6 changes: 4 additions & 2 deletions assets/src/js/admin/form-editor/field-forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,11 @@ forms.choice = function (config) {
visibleRows.push(rows.placeholder(config))
}

visibleRows.push(rows.useParagraphs(config))
if (config.type !== 'checkbox' && config.type !== 'radio') {
visibleRows.push(rows.useParagraphs(config))
}

if (config.type === 'select' || config.type === 'radio') {
if (config.type === 'select') {
visibleRows.push(rows.isRequired(config))
}

Expand Down
Loading