Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

formikation

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

formikation

  • 0.2.7
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Formikation

GitHub version

Simple form beautifier

Formikation is a simple jQuery plugin to beautify form inputs with some css.

The elements to work with are:

input:checkbox

input:radiobutton

input:file

select

Demo

Take a look to online demo, there are some examples with diferent themes.

HTML Requisites

The only html requisite is to style radiobuttons and checkboxes. Them must be wrapped by a label

<label>
  <input type="checkbox" name="check" id="check">
  Checkbox label
</label>

<label>
  <input type="radio" name="radio" id="radio">
  Radio label
</label>

Utility CSS

Formikation comes with a utility CSS that includes the neccessary CSS styles to work, without any visual styles on it. To add the utility CSS styles, add the .formikation class to yout form element this way:

    <form action="/" class="formikation" >
    ...

Themes

The visual styling of the formikation elements comes in an independet stylesheet, to keep separated the visual representation from the utility classes. Two themes are included in the repository .fk-theme-default and .fk-theme-switches.

Include the .fk-theme-default class on the parent element along the base .formikation class, this way:

    <form action="/" class="formikation fk-theme-default" >
    ...

If you want to develop your own theme, take a look to src/themes/fk-theme-default.scss and use it as base to do your own customization.

Initialization

Call Formikation jQuery plugin on ready function:

$(function() {

  $('form.formikation').find('select, input:file, input:checkbox, input:radio').formikation();

});

Update elements with JS

If you need to update any formikation element with js, it’s necessary to trigger formikation.update event to get UI change reflected.

// Active a checkbox
$('.form-element').prop('checked', true).trigger('formikation.update');

IE8

IE8 has some dificults on repainting :before and :after pseudo-elements after change checkbox or radiobuttons status.

Is simple to fix it, just change pseudo-element content from '' to ' ' (this fix is applied on default theme).

Changelog

  • 0.2.6 (2016/05/XX) Added .fk-is-placeholder to select option without value

FAQs

Package last updated on 12 Jul 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc