npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@ederssouza/sass-helpers

v1.0.6

Published

Functions, mixins and placeholders for speed up your development process.

Downloads

21

Readme

Sass Helpers

npm version

Functions, mixins and placeholders for speed up your development process.

Installation

npm install @ederssouza/sass-helpers --save-dev

How to use

Import the global index.scss file in your project.

@import '~@ederssouza/sass-helpers';

Mixins

See mixins.scss.

CSS3 animation

scss

.icon {
  width: 100px;
  height: 100px;
  background-color: red;
  @include animation(changeBg 4s);
}

@include keyframes(changeBg) {
  from {background-color: red;}
  to {background-color: yellow;}
}

css compiled

.icon {
  width: 100px;
  height: 100px;
  background-color: red;
  -webkit-animation: changeBg 4s;
  -moz-animation: changeBg 4s;
  animation: changeBg 4s;
}

@-webkit-keyframes changeBg {
  from {
    background-color: red;
  }
  to {
    background-color: yellow;
  }
}

@-moz-keyframes changeBg {
  from {
    background-color: red;
  }
  to {
    background-color: yellow;
  }
}

@keyframes changeBg {
  from {
    background-color: red;
  }
  to {
    background-color: yellow;
  }
}

CSS3 background-size

scss

.container {
  @include background-size(cover);
}

css compiled

.container {
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
}

CSS3 border-radius

scss

.container {
  @include border-radius(4px);
}

css compiled

.container {
  -webkit-border-radius: 4px;
  -moz-border-radius: 4px;
  border-radius: 4px;
}

CSS3 box-shadow

scss

.container {
  @include box-shadow(1px 1px 2px rgba(#000, .8));
}

css compiled

.container {
  -webkit-box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  -moz-box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

CSS3 @font-face

scss

$fonts-dir: '../fonts';

@include font-face('Roboto', 'roboto', 'regular');

css compiled

@font-face {
  font-family: "Roboto";
  src: url("../fonts/regular/roboto.eot");
  src: url("../fonts/regular/roboto.eot?#iefix") format("embedded-opentype"), url("../fonts/regular/roboto.woff") format("woff"), url("../fonts/regular/roboto.ttf") format("truetype"), url("../fonts/regular/roboto.svg#Roboto") format("svg");
}

CSS3 linear-gradient

scss

.container {
  @include linear-gradient(red, orange);
}

css compiled

.container {
  background: orange;
  background: -moz-linear-gradient(top, red 0%, orange 100%);
  background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, red), color-stop(100%, orange));
  background: -webkit-linear-gradient(top, red 0%, orange 100%);
  background: -o-linear-gradient(top, red 0%, orange 100%);
  background: linear-gradient(to bottom, red 0%, orange 100%);
}

opacity

scss

.container {
  @include opacity(.5);
}

css compiled

.container {
  opacity: 0.5;
  filter: alpha(opacity=50);
}

CSS3 placeholder input

scss

input, textarea {

  @include placeholder {
    font-style:italic;
  }
}

css compiled

input::-webkit-input-placeholder, textarea::-webkit-input-placeholder {
  font-style: italic;
}

input::-moz-placeholder, textarea::-moz-placeholder {
  font-style: italic;
}

input:-moz-placeholder, textarea:-moz-placeholder {
  font-style: italic;
}

input:-ms-input-placeholder, textarea:-ms-input-placeholder {
  font-style: italic;
}

tab-size

scss

pre {
  @include tab-size(2);
}

css compiled

pre {
  -webkit-tab-size: 2;
  -moz-tab-size: 2;
  -o-tab-size: 2;
  tab-size: 2;
}

CSS3 transform

scss

.icon {
  @include transform(scale(1.5));
}

css compiled

.icon {
  -webkit-transform: scale(1.5);
  -moz-transform: scale(1.5);
  -ms-transform: scale(1.5);
  transform: scale(1.5);
}

CSS3 transition

scss

button {
  background-color: #fff;
  @include transition(background-color .26s);

  &:hover {
    background-color: #333;
  }
}

css compiled

button {
  background-color: #fff;
  -webkit-transition: background-color 0.26s;
  -moz-transition: background-color 0.26s;
  -o-transition: background-color 0.26s;
  transition: background-color 0.26s;
}

button:hover {
  background-color: #333;
}

Helpers

center-vertical

scss

.icon {
  height: 100px;
  width: 100px;
  @include center-vertical;
}

css compiled

.icon {
  height: 100px;
  width: 100px;
  left: 50%;
  position: absolute;
  top: 50%;
  -webkit-transform: translate(-50%, -50%);
  -moz-transform: translate(-50%, -50%);
  -ms-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
}

sprite

scss

$img-dir: '../img';

.icon {
  @include sprite('sprite-icon.png', '0 50px', 50px, 50px);
}

css compiled

.icon {
  background-image: url("../img/sprite-icon.png");
  background-position: "0 50px";
  height: 50px;
  width: 50px;
}

Functions

See functions.scss.

Convert px to em

scss

$browser-context: 16;

.container {
  font-size: em(14)
}

css compiled

.container {
  font-size: 0.875em;
}

Placeholders

See placeholders.scss.

center-block

scss

.container {
  @extend %center-block;
}

css compiled

.container {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

clearfix

scss

.container {
  @extend %clearfix;
}

css compiled

.container:before,
.container:after {
  clear: both;
  content: "";
  display: block;
}

License

MIT License © Eder Sampaio