Please turn javascript on and reload the page

How to use

You should attach the base class to the root of your skeleton screen HTML. While this class has no styles attached to it, you can use it if you need to increase the specifity of your CSS if needed. + It also helps to keep the HTML a little bit more grouped.

Text

The simplest skeleton you can create is one of text that is loading. For this we can use the class.

div class="c-skeleton">
    div class="c-skeleton__text">div>
div>

Modifiers

/* Removes the margin on top/bottom of the text */
.c-skeleton__text--small-height {...}

/* Makes the display style inline block */
.c-skeleton__text--inline {...}

/* Makes the text width full width */
.c-skeleton__text--full {...}

/* Makes the text width big */
.c-skeleton__text--big {...}

/* Makes the text width bigger */
.c-skeleton__text--bigger {...}

/* Makes the text width small */
.c-skeleton__text--small {...}

/* Makes the text width smaller */
.c-skeleton__text--smaller {...}

/* Makes the text width very tiny */
.c-skeleton__text--tiny {...}

Image / Video / etc.

If you want to skeleton an image/video, you can use the class . This class adjusts to the parents width and height.

div class="c-skeleton" style="width: 50px; height: 50px;">
    div class="c-skeleton__figure">div>
div>

Pro tip: If the non loading state has a border radius, you simply can add a class to it that adds the border radius to the skeleton aswell. In most cases, the skeleton can have the same classes attached as the loaded state!

Developing

Here’s a brief intro about what a developer must do in order to start developing
the project further:

git clone https://github.com/Itrulia/nova-skeletons
cd nova-skeletons/
npm install

This will download all dependencies so that you are ready to go.

Deploying / Publishing

You will need to publish this to the github and npm repository.

To do this you will need to do the following steps:

  • As soon as you are done with development (don’t forget the tests if necessary please 😉 ) please commit your code
  • Please push your code to master now and set a tag (same version as you set earlier) with a prefix (e.g. ) and add release notes for what has changed so everyone knows what to do when there are breaking changes and what has changed for them.

Licensing

Copyright (c) 2018 Karl Merkli

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the «Software»), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED «AS IS», WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Ссылка на основную публикацию