semantic-forms 3.0.7 → 3.1.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 +7 -14
- package/package.json +14 -11
- package/semanticForms.css +252 -161
- package/semanticForms.js +85 -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,7 @@ 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.
|
|
26
|
-
|
|
27
|
-
If you add new forms to the DOM after the initial initialization, you can call the global `semanticForms` function to initialize new forms that have been added to the DOM since the initial initialization.
|
|
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.
|
|
21
|
+
Then the CSS/JS enhancements to your forms will apply automatically, assuming the markup structure you use is one of the supported patterns.
|
|
30
22
|
|
|
31
23
|
# Features
|
|
32
24
|
|
|
@@ -58,9 +50,7 @@ The float label input pattern is notoriously difficult to implement in a fashion
|
|
|
58
50
|
</form>
|
|
59
51
|
```
|
|
60
52
|
|
|
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.
|
|
53
|
+
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
54
|
|
|
65
55
|
Adjust the horizontal offset of the clear field's click event click area (the default is 21):
|
|
66
56
|
|
|
@@ -78,6 +68,8 @@ Adjust the vertical offset of the clear field's click event click area (the defa
|
|
|
78
68
|
</form>
|
|
79
69
|
```
|
|
80
70
|
|
|
71
|
+
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.
|
|
72
|
+
|
|
81
73
|
## Button groups
|
|
82
74
|
|
|
83
75
|
You can align buttons side-by-side, or in left/right/center groups.
|
|
@@ -99,7 +91,7 @@ Driven by flexbox to intelligently align the buttons based on how many are in th
|
|
|
99
91
|
<!-- aligns left/right -->
|
|
100
92
|
<menu>
|
|
101
93
|
<li><button type="submit" name="submit">Button 1</button></li>
|
|
102
|
-
<button type="submit" name="submit">Button 2</button></li>
|
|
94
|
+
<li><button type="submit" name="submit">Button 2</button></li>
|
|
103
95
|
</menu>
|
|
104
96
|
|
|
105
97
|
<!-- aligns left/center/right -->
|
|
@@ -165,9 +157,10 @@ Not too different than other inputs:
|
|
|
165
157
|
- Custom-styled select boxes with a custom drawn arrow graphic driven by SVG embedded in the CSS.
|
|
166
158
|
- Custom-styled submit buttons to match the aesthetic of the custom-styled forms.
|
|
167
159
|
- Responsive: on wide screens, the forms split into multiple columns. On smaller screens, they collapse to a single column.
|
|
160
|
+
- Dark mode: apply an additional class of `dark` to your `<form>` elements to use the dark mode.
|
|
168
161
|
- 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
162
|
|
|
170
|
-
See `semanticForms.html` or the [live demo](https://kethinov.github.io/semanticforms/semanticForms.html) for
|
|
163
|
+
See `semanticForms.html` or the [live demo](https://kethinov.github.io/semanticforms/semanticForms.html) for a full demo of all the markup patterns.
|
|
171
164
|
|
|
172
165
|
# Contributing
|
|
173
166
|
|
package/package.json
CHANGED
|
@@ -2,31 +2,34 @@
|
|
|
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.1.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",
|
|
19
|
-
"main": "
|
|
13
|
+
"main": "semanticForms.js",
|
|
20
14
|
"readmeFilename": "README.md",
|
|
21
15
|
"dependencies": {},
|
|
22
16
|
"devDependencies": {
|
|
23
|
-
"less": "4.
|
|
17
|
+
"less": "4.2.0",
|
|
18
|
+
"eslint": "8.56.0",
|
|
19
|
+
"eslint-plugin-html": "7.1.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",
|