semantic-forms 3.0.8 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -13
- package/package.json +13 -10
- package/semanticForms.css +252 -161
- package/semanticForms.js +91 -125
- package/{semanticFormsNoImages.less → semanticForms.less} +243 -76
- package/semanticFormsImages.less +0 -15
- package/semanticFormsImagesReset.less +0 -5
- package/semanticFormsNoImages.css +0 -369
- package/semanticFormsNoImagesReset.css +0 -372
- package/semanticFormsNoImagesReset.less +0 -5
- package/semanticFormsReset.css +0 -379
package/README.md
CHANGED
|
@@ -10,10 +10,6 @@ See a [live demo here](https://kethinov.github.io/semanticforms/semanticForms.ht
|
|
|
10
10
|
|
|
11
11
|
Include the `semanticForms.css` and `semanticForms.js` files from this repo into your project.
|
|
12
12
|
|
|
13
|
-
If you want to set your own images for the clear fields and dropdown arrows, then include the `semanticFormsNoImages.css` and `semanticForms.js` files from this repo into your project instead, as they do not have any preset images embedded in the CSS and will result in a smaller dependency size.
|
|
14
|
-
|
|
15
|
-
If you have CSS inheritance conflicts with other CSS in your webapp, try including the "reset" versions of the semantic forms CSS files (`semanticFormsReset.css` or `semanticFormsNoImagesReset.css`) which set `all: unset;` before applying any semantic-forms styles to help avoid conflicts with other CSS. There is a performance degradation to using this technique, so you should only use this if absolutely necessary.
|
|
16
|
-
|
|
17
13
|
Then apply the `semanticForms` class to your `<form>` elements:
|
|
18
14
|
|
|
19
15
|
```html
|
|
@@ -22,11 +18,9 @@ Then apply the `semanticForms` class to your `<form>` elements:
|
|
|
22
18
|
</form>
|
|
23
19
|
```
|
|
24
20
|
|
|
25
|
-
Then the CSS/JS enhancements to your forms will apply automatically.
|
|
21
|
+
Then the CSS/JS enhancements to your forms will apply automatically, assuming the markup structure you use is one of the supported patterns.
|
|
26
22
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
See `semanticForms.html` or the [live demo](https://kethinov.github.io/semanticforms/semanticForms.html) for a complete pattern library with examples of all UI patterns.
|
|
23
|
+
This library also monitors changes to the DOM and will enhance any additional `semanticForms` forms you insert, but the monitoring may not be perfect. If you want to re-scan for new forms to enhance manually, simply call `window.semanticForms()`. If you only want to reinitialize one form instead of all of them, call `window.semanticForms.reinitialize(formName)`.
|
|
30
24
|
|
|
31
25
|
# Features
|
|
32
26
|
|
|
@@ -58,9 +52,7 @@ The float label input pattern is notoriously difficult to implement in a fashion
|
|
|
58
52
|
</form>
|
|
59
53
|
```
|
|
60
54
|
|
|
61
|
-
If you would like to manipulate the size of the area on the input field reserved for the click event of the clear field, apply one or both of the following `data-` attributes to your form
|
|
62
|
-
|
|
63
|
-
If you want to double the width of the input field (on screens with the extra space), add a `x2` class to the `dd` element.
|
|
55
|
+
If you would like to manipulate the size of the area on the input field reserved for the click event of the clear field, apply one or both of the following `data-` attributes to your form:
|
|
64
56
|
|
|
65
57
|
Adjust the horizontal offset of the clear field's click event click area (the default is 21):
|
|
66
58
|
|
|
@@ -78,6 +70,8 @@ Adjust the vertical offset of the clear field's click event click area (the defa
|
|
|
78
70
|
</form>
|
|
79
71
|
```
|
|
80
72
|
|
|
73
|
+
If you want to double the width of the input field (on screens with the extra space), add a `x2` class to the `dd` element.
|
|
74
|
+
|
|
81
75
|
## Button groups
|
|
82
76
|
|
|
83
77
|
You can align buttons side-by-side, or in left/right/center groups.
|
|
@@ -99,7 +93,7 @@ Driven by flexbox to intelligently align the buttons based on how many are in th
|
|
|
99
93
|
<!-- aligns left/right -->
|
|
100
94
|
<menu>
|
|
101
95
|
<li><button type="submit" name="submit">Button 1</button></li>
|
|
102
|
-
<button type="submit" name="submit">Button 2</button></li>
|
|
96
|
+
<li><button type="submit" name="submit">Button 2</button></li>
|
|
103
97
|
</menu>
|
|
104
98
|
|
|
105
99
|
<!-- aligns left/center/right -->
|
|
@@ -165,9 +159,10 @@ Not too different than other inputs:
|
|
|
165
159
|
- Custom-styled select boxes with a custom drawn arrow graphic driven by SVG embedded in the CSS.
|
|
166
160
|
- Custom-styled submit buttons to match the aesthetic of the custom-styled forms.
|
|
167
161
|
- Responsive: on wide screens, the forms split into multiple columns. On smaller screens, they collapse to a single column.
|
|
162
|
+
- Dark mode: apply an additional class of `dark` to your `<form>` elements to use the dark mode.
|
|
168
163
|
- Low-flow mode that displays on old browsers, JS-disabled browsers, or can be activated manually by adding the `lowFlow` class to your `<form>` element. The low-flow mode reverts the float label pattern to traditional labels and collapses the forms to single column mode, but preserves the other visual design enhancements driven purely by CSS.
|
|
169
164
|
|
|
170
|
-
See `semanticForms.html` or the [live demo](https://kethinov.github.io/semanticforms/semanticForms.html) for
|
|
165
|
+
See `semanticForms.html` or the [live demo](https://kethinov.github.io/semanticforms/semanticForms.html) for a full demo of all the markup patterns.
|
|
171
166
|
|
|
172
167
|
# Contributing
|
|
173
168
|
|
package/package.json
CHANGED
|
@@ -2,17 +2,11 @@
|
|
|
2
2
|
"name": "semantic-forms",
|
|
3
3
|
"description": "Semantic Forms",
|
|
4
4
|
"author": "Eric Newport <kethinov@gmail.com>",
|
|
5
|
-
"version": "3.0
|
|
5
|
+
"version": "3.2.0",
|
|
6
6
|
"files": [
|
|
7
7
|
"semanticForms.css",
|
|
8
8
|
"semanticForms.js",
|
|
9
|
-
"
|
|
10
|
-
"semanticFormsNoImages.css",
|
|
11
|
-
"semanticFormsNoImages.less",
|
|
12
|
-
"semanticFormsReset.css",
|
|
13
|
-
"semanticFormsImagesReset.less",
|
|
14
|
-
"semanticFormsNoImagesReset.css",
|
|
15
|
-
"semanticFormsNoImagesReset.less"
|
|
9
|
+
"semanticForms.less"
|
|
16
10
|
],
|
|
17
11
|
"homepage": "https://github.com/kethinov/semanticforms",
|
|
18
12
|
"license": "CC-BY-4.0",
|
|
@@ -20,13 +14,22 @@
|
|
|
20
14
|
"readmeFilename": "README.md",
|
|
21
15
|
"dependencies": {},
|
|
22
16
|
"devDependencies": {
|
|
23
|
-
"less": "4.
|
|
17
|
+
"less": "4.2.0",
|
|
18
|
+
"eslint": "8.57.0",
|
|
19
|
+
"eslint-plugin-html": "8.0.0",
|
|
24
20
|
"standard": "17.1.0"
|
|
25
21
|
},
|
|
22
|
+
"eslintConfig": {
|
|
23
|
+
"extends": [
|
|
24
|
+
"standard"
|
|
25
|
+
]
|
|
26
|
+
},
|
|
26
27
|
"scripts": {
|
|
27
28
|
"test": "echo \"TODO: tests\"",
|
|
28
29
|
"coverage": "echo \"TODO: test coverage\"",
|
|
29
|
-
"
|
|
30
|
+
"lint": "standard && standard --plugin html *.html",
|
|
31
|
+
"lint-fix": "standard --fix && standard --plugin html *.html --fix",
|
|
32
|
+
"build": "lessc semanticForms.less semanticForms.css"
|
|
30
33
|
},
|
|
31
34
|
"repository": {
|
|
32
35
|
"type": "git",
|