Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
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
4 changes: 2 additions & 2 deletions form.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "style-forge.form",
"version": "2025.1.22",
"version": "2025.1.24",
"description": "Style-Forge.Form: versatile library for easy form creation, validation, styling, and submission in web apps.",
"type": "module",
"main": "form.css",
Expand Down
24 changes: 5 additions & 19 deletions src/button.css
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
:root {
--sf-form-ff: 'Inter', ui-sans-serif, system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
--sf-form-fz: 0.9375rem;
--sf-disabled: 0.4;
--sf-radius: 3px;
--sf-form-p-input-block: 0.5em;
--sf-form-p-input-inline: 0.5em;
}

.sf-button {
cursor: pointer;

display: inline-block;

font-size: var(--sf-form-fz);
font-family: var(--sf-form-ff);
font-weight: 400;
font-size: 15px;
font-family: inherit;
font-weight: inherit;
line-height: 1;

color: hsl(var(--sf-c-form-txt));
Expand All @@ -32,7 +23,7 @@

height: 32px;

padding: var(--sf-form-p-input-block) var(--sf-form-p-input-inline);
padding: var(--sf-elm-py) var(--sf-elm-px);

box-sizing: border-box;

Expand All @@ -54,13 +45,8 @@ a.sf-button:not([href]),

/* /// */

html.var .sf-button
{
font-size: 15px;
font-family: 'Inter', ui-sans-serif, system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';

html.var .sf-button {
border-radius: 3px;

padding: 8px;
}

Expand Down
5 changes: 0 additions & 5 deletions src/checkbox-radio.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
:root {
--sf-form-fz: 0.9375rem;
--sf-disabled: 0.4;
}

label.sf-radio, label.sf-checkbox { box-sizing: border-box }

label.sf-radio *,
Expand Down
5 changes: 0 additions & 5 deletions src/color.css
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
:root {
--sf-form-fz: 0.9375rem;
--sf-disabled: 0.4;
}

.sf-input[type='color'] {
cursor: pointer;

Expand Down
23 changes: 6 additions & 17 deletions src/file.css
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
:root {
--sf-form-ff: 'Inter', ui-sans-serif, system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
--sf-form-fz: 0.9375rem;
--sf-disabled: 0.4;
--sf-radius: 3px;
}

.sf-input[type='file'] {
cursor: pointer;

font-size: var(--sf-form-fz);
font-family: var(--sf-form-ff);
font-weight: 400;
font-size: 15px;
font-family: inherit;
font-weight: inherit;
line-height: 1;

border: 0;
Expand All @@ -27,9 +20,9 @@

display: inline-block;

font-size: var(--sf-form-fz);
font-family: var(--sf-form-ff);
font-weight: 400;
font-size: 15px;
font-family: inherit;
font-weight: inherit;
line-height: 1;

text-align: center;
Expand Down Expand Up @@ -61,13 +54,9 @@
/* /// */

html.var .sf-input[type='file'] {
font-size: 15px;
font-family: 'Inter', ui-sans-serif, system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
padding: 0; /* required */
}
html.var .sf-input[type='file']::file-selector-button {
font-size: 15px;
font-family: 'Inter', ui-sans-serif, system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
color: hsl(0, 0%, 10%);
background: hsla(0, 0%, 100%, 0.2);
border: 1px solid hsla(0, 0%, 10%, 0.2);
Expand Down
28 changes: 5 additions & 23 deletions src/input.css
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
:root {
--sf-form-ff: 'Inter', ui-sans-serif, system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';

--sf-form-fz: 0.9375rem;

--sf-disabled: 0.4;

--sf-radius: 3px;

--sf-form-p-input-block: 0.5em;
--sf-form-p-input-inline: 0.5em;
}

.sf-input *,
.sf-input *::before,
.sf-input *::after
Expand All @@ -21,9 +8,9 @@
.sf-input {
cursor: auto;

font-size: var(--sf-form-fz);
font-family: var(--sf-form-ff);
font-weight: 400;
font-size: 15px;
font-family: inherit;
font-weight: inherit;
line-height: 1;

text-transform: none;
Expand All @@ -41,7 +28,7 @@
width: 100%;
height: 32px;

padding: var(--sf-form-p-input-block) var(--sf-form-p-input-inline);
padding: var(--sf-elm-py) var(--sf-elm-px);

box-sizing: border-box;
vertical-align: top;
Expand Down Expand Up @@ -89,12 +76,7 @@

/* /// */

html.var .sf-input {
font-size: 15px;
font-family: 'Inter', ui-sans-serif, system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';

padding: 8px;
}
html.var .sf-input { padding: 8px }

html.var .sf-input:not([class*='sf-c-']) {
color: hsl(0, 0%, 10%);
Expand Down
31 changes: 7 additions & 24 deletions src/select.css
Original file line number Diff line number Diff line change
@@ -1,26 +1,15 @@
:root {
--sf-form-ff: 'Inter', ui-sans-serif, system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
--sf-form-fz: 0.9375rem;
--sf-lh-normal: 1.1875;
--sf-disabled: 0.4;
--sf-radius: 3px;
--sf-form-p-input-block: 0.5em;
--sf-form-p-input-inline: 0.5em;
}

.sf-select,
.sf-select option
{
font-size: var(--sf-form-fz);
font-family: var(--sf-form-ff);
font-weight: 400;
line-height: var(--sf-lh-normal);
font-size: 15px;
font-family: inherit;
font-weight: inherit;

text-transform: none;
}
.sf-select { padding: var(--sf-form-p-input-block) var(--sf-form-p-input-inline) }
.sf-select option { padding: calc(var(--sf-form-p-input-block) / 2) var(--sf-form-p-input-inline) }
.sf-select optgroup { padding: calc(var(--sf-form-p-input-block) / 2) 0 0 }
.sf-select { padding: var(--sf-elm-py) var(--sf-elm-px) }
.sf-select option { padding: calc(var(--sf-elm-py) / 2) var(--sf-elm-px) }
.sf-select optgroup { padding: calc(var(--sf-elm-py) / 2) 0 0 }

.sf-select {
cursor: pointer;
Expand All @@ -40,7 +29,7 @@

.sf-select:not([multiple]) {
height: 32px;
padding: 0 var(--sf-form-p-input-inline);
padding: 0 var(--sf-elm-px);
border-width: 0 0 1px;
}

Expand All @@ -61,12 +50,6 @@

/* /// */

html.var .sf-select,
html.var .sf-select option
{
font-size: 15px;
font-family: 'Inter', ui-sans-serif, system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
}
html.var .sf-select:not([multiple]) { padding: 0 0 0 8px }
html.var .sf-select { padding: 8px 0 8px 8px }

Expand Down
29 changes: 8 additions & 21 deletions src/switch.css
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
:root {
--sf-form-ff: 'Inter', ui-sans-serif, system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
--sf-form-fz: 0.9375rem;
--sf-form-fz-small: 0.75rem;
--sf-disabled: 0.4;
--sf-form-p-input-block: 0.5em;
--sf-form-p-input-inline: 0.5em;
--sf-form-switch-size: 1rem;
}

.sf-switch { box-sizing: border-box }

.sf-switch.multiple *,
Expand All @@ -16,15 +6,17 @@
{ box-sizing: inherit }

.sf-switch {
font-size: var(--sf-form-fz);
font-family: var(--sf-form-ff);
font-weight: 400;
font-size: 15px;
font-family: inherit;
font-weight: inherit;
line-height: 1;

text-transform: none;
}

label.sf-switch input[type='checkbox'] {
--sf-form-switch-size: 1rem;

position: relative;

appearance: none;
Expand Down Expand Up @@ -88,12 +80,12 @@ label.sf-switch input[type='checkbox'] ~ *
.sf-switch.multiple .sf-switch-toggle * { display: inline-block }
.sf-switch.multiple .sf-switch-toggle label { position: relative }
.sf-switch.multiple .sf-switch-toggle span {
font-size: var(--sf-form-fz-small);
font-size: 12px;
text-align: center;

min-width: 32px;

padding: var(--sf-form-p-input-block) var(--sf-form-p-input-inline);
padding: var(--sf-elm-py) var(--sf-elm-px);

background: hsl(var(--sf-c-form-bd) / 5%);
}
Expand Down Expand Up @@ -137,7 +129,7 @@ label.sf-switch input[type='checkbox'] ~ *
.sf-switch.multiple.vert .sf-switch-toggle { flex-flow: column }

.sf-switch.multiple .sf-switch-description {
font-size: var(--sf-form-fz-small);
font-size: 12px;
margin: 0.5em 0 0;
padding: 0 0 0.5em;
}
Expand Down Expand Up @@ -174,11 +166,6 @@ label.sf-switch input[type='checkbox'] ~ *

/* /// */

html.var .sf-switch {
font-size: 15px;
font-family: 'Inter', ui-sans-serif, system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
}

html.var label.sf-switch input[type='checkbox'] {
width: 16px;
height: 16px;
Expand Down
22 changes: 5 additions & 17 deletions src/textarea.css
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
:root {
--sf-form-ff: 'Inter', ui-sans-serif, system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
--sf-form-fz: 0.9375rem;
--sf-disabled: 0.4;
--sf-radius: 3px;
--sf-form-p-input-block: 0.5em;
--sf-form-p-input-inline: 0.5em;
}

.sf-textarea {
font-size: var(--sf-form-fz);
font-family: var(--sf-form-ff);
font-weight: 400;
font-size: 15px;
font-family: inherit;
font-weight: inherit;
line-height: 1.499535;

color: hsl(var(--sf-c-form-txt));
Expand All @@ -22,9 +13,9 @@

width: 100%;
max-width: 100%;
min-height: calc((1.499535em + 2px + var(--sf-form-p-input-block)) * 4);
min-height: calc((1.499535em + 2px + var(--sf-elm-py)) * 4);

padding: var(--sf-form-p-input-block) var(--sf-form-p-input-inline);
padding: var(--sf-elm-py) var(--sf-elm-px);

border-radius: var(--sf-radius);

Expand Down Expand Up @@ -53,9 +44,6 @@
/* /// */

html.var .sf-textarea {
font-size: 15px;
font-family: 'Inter', ui-sans-serif, system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';

min-height: calc((1.499535em + 2px + 0.5em) * 4);

padding: 8px;
Expand Down
21 changes: 6 additions & 15 deletions src/validate.css
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
:root {
--sf-form-ff: 'Inter', ui-sans-serif, system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
--sf-form-fz-small: 0.75rem;
--sf-lh-normal: 1.1875;
--sf-disabled: 0.4;
}

.sf-description, .sf-invalid, .sf-valid {
color: hsl(var(--sf-c-form-txt) / 40%);

font-size: var(--sf-form-fz-small);
font-family: var(--sf-form-ff);
font-size: 12px;
font-family: inherit;
font-weight: 300;
line-height: 1;

text-transform: none;

margin: 0.5em 0 0;
padding: 0 0 0.5em;
margin-top: 0.5em;
padding-bottom: 0.5em;
}

.sf-description, .sf-invalid, .sf-valid { display: none }
Expand Down Expand Up @@ -81,7 +74,8 @@ label.validates.sf-checkbox .sf-description,
label.validates.sf-checkbox .sf-valid,
label.validates.sf-checkbox .sf-invalid {
width: 100%;
line-height: var(--sf-lh-normal);
/* --sf-lh-normal: 1.1875; */
/* line-height: var(--sf-lh-normal); */
}

form.validates:invalid .sf-button[type='submit'] {
Expand All @@ -97,9 +91,6 @@ html.var .sf-description,
html.var .sf-invalid,
html.var .sf-valid {
color: hsla(0, 0%, 10%, 0.4);

font-size: 12px;
font-family: 'Inter', ui-sans-serif, system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
}

html.var label.validates.sf-switch .sf-description,
Expand Down
Loading
Loading