Giter Site home page Giter Site logo

shy's Introduction

Shy

2016-09-24

Shy is a css convention for implementing fast css selectors.

Documentation

shy is a system for naming your dom target elements based on fast selectors.

shy only uses/is applied to css classes.

The shy system is as follow:

  • the default case is camelCase, for instance: closeBtn
  • hierarchy is induced by one underscore between the parent and its child, for instance: container_child_subChild
  • namespace is induced by two underscores between the "module" name and the "target" name, for instance: myModule__logo
  • states are induced by two dashes between the "module" name and the "state" name, for instance navDrawer--open

I recommend that you never use the hierarchy notation, but use namespace notation instead.

Random thoughts

You shouldn't use hierarchy, but rather namespaces.

That's because hierarchy tends to be more verbose, and so in the end it makes more bytes to download.

For instance, using the hierarchy system, you can end up with this type of class:

<div class="container_header_topDiv_logo"></div>

If you were using the namespace system, you could just use something like that:

<div class="myModule__logo"></div>

Why shy?

I don't know, I just like the should of it, and that's the first idea that came in.

shy's People

Contributors

lingtalfi avatar

Watchers

 avatar James Cloos avatar

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.