Giter VIP home page Giter VIP logo

floatl's People

Contributors

daniel-chapman-eqtr avatar dependabot-support avatar dependabot[bot] avatar gberger avatar greenkeeperio-bot avatar leptest avatar richardvenneman avatar syed-haroon avatar zlatevbg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

floatl's Issues

AngularJS usage example

In my case I use jQuery as well but it is not necessary.

function initializeFloatl(root) {
  root = root || document;
  var $root = $(root);

  var elements;
  if ($root.hasClass('floatl')) {
    elements = $root;
  } else {
    elements = $root.find('.floatl');
  }

  elements.each(function (i, el) {
    var element = $(el);

    if (element.data('floatl-initialized')) return;
    element.data('floatl-initialized', true);

    element.find('label').addClass('floatl__label');
    element.find('input,textarea').addClass('floatl__input');

    new Floatl(element);
  });
};
  .directive('ngFloatl', function () {
    return {
      link: function (scope, elem, attrs, ctrl) {
        angular.element(elem).addClass('floatl');
        console.log(elem);
        initializeFloatl(elem);
      }
    }
  })
<div ng-floatl>
  <label>First name</label>
  <input placeholder="First name" type="text" />
</div>

Suggestion: option to change class names.

Would it be possible to add an option to change the class names of the elements? For projects that don't use the CSS BEM method for naming classes but something else it can be very odd.

VueJS integration

Hi, I just published a VueJS integration of your floatl lib here.

Can you please mention it on your README or wiki ?
if it can help.

Thanks for your lib

Ben.

Example provided is non-accessible

The example provided within the README.md file does not associate the label element with a particular input element, preventing assistive technologies from being able to describe form elements to their users. Suggest updating the following example in the README.md:

<div class="floatl">
  <label class="floatl__label" for="firstName">First name</label>
  <input class="floatl__input" placeholder="First name" type="text" id="firstName">
</div>

It's probably worthwhile to test this library as well with the following pattern, which is common and removed the need for the for attribute:

<div class="floatl">
  <label class="floatl__label">First name
    <input class="floatl__input" placeholder="First name" type="text">
  </label>
</div>

Replace Gulp with npm scripts

In an effort to minimise dependencies I'd like to remove Gulp, as it is currently the only hard dependency of this component. It seems like npm scripts are the way to go.

Some ideas:

  • Replace gulp-sass with node-sass
  • Replace gulp-autoprefixer with postcss-cli and autoprefixer
  • Replace gulp-uglify with webpack.optimize.UglifyJsPlugin
  • Replace gulp-sourcemaps with source-map-loader?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.