Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/2.2.0 #99

Merged
merged 8 commits into from
Nov 1, 2024
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
3 changes: 3 additions & 0 deletions docs/en/form.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,6 @@ $component-form-text-with-button-properties: (
## Form Process Animation
When a form is submitted all fields are disabled including the submit button. An animated icon is added next to the submit button as well.
You must opt-in for this to take effect, the form element must contain the following class: `fw-form-process-event` as well as the `fw-form` class.

## Label placements
By default, labels are placed inside the input box. To change this, simply add the `fw-form-label-above` class alongside the `fw-form` class. This adjustment moves labels above the fields, eliminating any animation when a field gains or loses focus.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "werkbot-framewerk",
"version": "2.1.17",
"version": "2.2.0",
"description": "A framework of css and javascript that Werkbot uses as a foundation to build our websites.",
"main": "js/form.js",
"directories": {
Expand Down
3 changes: 2 additions & 1 deletion sass/components/form/_form.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ $default-component-form-properties:(
validationSuccessTextColor: #000000,
validationSuccessBackgroundColor: #00cc00,
validationWarningTextColor: #000000,
validationWarningBackgroundColor: #ffcc00
validationWarningBackgroundColor: #ffcc00,
labelAboveMargin: 0,
);
// If $component-form-checkbox-properties is set, lets merge into our defaults
$component-form-properties: $default-component-form-properties !default;
Expand Down
9 changes: 9 additions & 0 deletions sass/components/form/components/_numeric.scss
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,13 @@ $component-form-numeric-properties: $default-component-form-numeric-properties !
}
}
}

// Label above field
&.fw-form-label-above{
.field.numeric{
input, input[type='number']{
padding: 9px 50px;
}
}
}
}
19 changes: 19 additions & 0 deletions sass/components/form/components/_select.scss
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,25 @@ $component-form-select-properties: $default-component-form-select-properties !de
pointer-events: none;
}
}

// Label above field
&.fw-form-label-above{
.field.dropdown{
label{
position: relative;
transform: none;
margin: getThemeProperty(labelAboveMargin, $component-form-properties);
&.labelShrunk{
transform: none;
}
}
select{
&.labelShrunk{
padding: 20px;
}
}
}
}
}
@-moz-document url-prefix() {
.fw-form{
Expand Down
19 changes: 19 additions & 0 deletions sass/components/form/components/_text-with-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,25 @@ $component-form-text-with-button-properties: $default-component-form-text-with-b
border-radius: getThemeProperty(buttonBorderRadius, $component-form-text-with-button-properties);
}
}
}

// Label above field
&.fw-form-label-above{
.field.text-with-button{
label{
position: relative;
transform: none;
margin: getThemeProperty(labelAboveMargin, $component-form-properties);
&.labelShrunk{
transform: none;
}
}
input{
padding: 20px;
&.labelShrunk{
padding: 20px;
}
}
}
}
}
20 changes: 20 additions & 0 deletions sass/components/form/components/_text.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,24 @@ $component-form-text-properties: $default-component-form-text-properties !defaul
}
}
}

// Label above field
&.fw-form-label-above{
.field.text{
label{
position: relative;
transform: none;
margin: getThemeProperty(labelAboveMargin, $component-form-properties);
&.labelShrunk{
transform: none;
}
}
input{
padding: 20px;
&.labelShrunk{
padding: 20px;
}
}
}
}
}
20 changes: 20 additions & 0 deletions sass/components/form/components/_textarea.scss
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,24 @@ $component-form-textarea-properties: $default-component-form-textarea-properties
}
}
}

// Label above field
&.fw-form-label-above{
.field.textarea{
label{
position: relative;
transform: none;
margin: getThemeProperty(labelAboveMargin, $component-form-properties);
&.labelShrunk{
transform: none;
}
}
textarea{
padding: 20px;
&.labelShrunk{
padding: 20px;
}
}
}
}
}
Loading