-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
77 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,16 @@ | ||
// This file is only used for development purposes and won't be integrated into | ||
// other components in any way. | ||
@import url('https://fonts.googleapis.com/css?family=Lato'); | ||
|
||
html, | ||
body { | ||
font-family: 'Lato', sans-serif; | ||
} | ||
|
||
// transitions only after page load | ||
body:not(.transition-ready) { | ||
&, | ||
* { | ||
transition: none !important; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,53 @@ | ||
# Form Components | ||
|
||
> Custom Form Components. Without Any Framework. | ||
Have a look at the component list on the left side. | ||
## Installation | ||
|
||
Using npm: | ||
|
||
```bash | ||
$ npm install @julmot/form-components | ||
``` | ||
|
||
Using a CDN: | ||
|
||
- [jsDelivr](https://www.jsdelivr.com/package/npm/@julmot/form-components?path=dist) | ||
|
||
You can embed individual form components from the `dist` folder. They are available as CommonJS (e.g. Webpack), AMD (e.g. RequireJS) and global (attached to the `window` object) packages with their corresponding CSS files. | ||
|
||
## Getting Started | ||
|
||
After you've embedded the components you want to use (including their CSS files), you need to initialize them. Create a new class instance of the exported `default` class. In case you'd like to dynamically initialize instances, you can use the also exported `selector` string to determine if a component exists. | ||
|
||
For example when using Webpack with ES6: | ||
|
||
```js | ||
import '@julmot/form-components/dist/message/message.css'; | ||
import * as Message from '@julmot/form-components/dist/message/message'; | ||
|
||
new Message.default(document.querySelector(Message.selector)); | ||
``` | ||
|
||
## Currently Available Components | ||
|
||
- Select | ||
- Text Field (single and multi line) | ||
- Checkbox | ||
- Message (e.g. to output validation messages at the top of a document) | ||
|
||
|
||
## Browser Compatibility | ||
|
||
Successfully tested in: | ||
|
||
- IE11 (Windows) | ||
- Latest Edge (Windows) | ||
- Latest Chrome (macOS and Windows) | ||
- Latest Firefox (macOS and Windows) | ||
- Latest Chrome Mobile (Android) | ||
- Latest Safari Mobile (iOS) | ||
|
||
## Requirements | ||
|
||
- Root _content_ element must be the `<main>` element (necessary for detection of inline messages) | ||
- Work best with embedded [normalize.css](https://github.com/necolas/normalize.css) | ||
- Inherits your app-specific fonts |