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

sass-table-stylization

v1.0.1

Published

SASS mixin to simplify the styling of the table

Downloads

3

Readme

sass-table-stylization

Sass mixin that allows you to simplify styling table and making it responsive. Originally written for use at Stock Price Alert Service

Installing

npm

To install sass-table-stylization using npm, simply run:

npm install sass-table-stylization

If you'd like to save sass-table-stylization as a dependency in your project's package.json file, run:

npm install sass-table-stylization --save

Bower

To install sass-table-stylization using bower, simply run

bower install sass-table-stylization

If you'd like to save sass-table-stylization as a dependency in your project's bower.json file, run:

bower install sass-table-stylization --save

Manually

Simply download the _sass_table_stylization.scss file from this repo and place it somewhere useful.

curl

curl -O https://raw.githubusercontent.com/MaksymBlank/sass-table-stylization/master/_sass_table_stylization.scss

wget

wget https://raw.githubusercontent.com/MaksymBlank/sass-table-stylization/master/_sass_table_stylization.scss

Using

Import _sass_table_stylization.scss in your main.scss

@import './_sass_table_stylization';

Include mixin _responsive_table($options, $styles, $media_query)

@include _responsive_table($options, $styles, $media_query);

Example

$options:   (
            table_name: 'responsive-table',
            properties: ('display', 'color', 'text-align')
            );

$styles:    (
            name: (null, grey, center),
            price: (null, blue, null),
            status: (null, null, center)
            );

$media_query: null // Making styles for all devices

@include _responsive_table($options, $styles, $media_query);

// OUTPUT
/*
    .responsive-table-name{
        // display is missing because it equals null
        color: grey;
        text-align: center;
    }

    .responsive-table-price{
        // display is missing because it equals null
        color: grey;
        // text-align is missing because it equals null
    }

    .responsive-table-status{
        // display is missing because it equals null
        // color is missing because it equals null
        text-align: center;
    }
*/

Parameters

$options:map

  • table_name:string - Name of the table's class.

  • table_set_title:boolean - true if you want to add class with the same name, but 'title' at the end of the class's name for columns titles

  • properties:list - List of all properties that will be using in table

  • title_properties_no_show:list - List of all properties that will be forbidden to use in titles classes

$styles:map

  • any_name:map_key( properies:list ) - list of all properties for current name.

e.g. if any_name equals 'price', it will make the class '.responsive-table-price' in the output above. The list of properties will be added to the current class.

.table_name-styles_map_key {      properties[i]: styles_map_key_value[i]; }

$media_query

$media_query:number - max-width breakpoints for @media()

@media(max-width: $media_query + 'px'){
    ...
}

Example with 'title'

Set parameter table_set_title if you want to create special classes for titles (.table_name-styles_map_key-title)

$options:   (
            table_name: 'responsive-table',
            table_set_title: true, // Creates special classes for titles
            properties: ('display', 'color', 'text-align'),
            title_properties_no_show: ('color') // Ignore color property for titles
            );

$styles:    (
            name: (null, grey, center),
            price: (null, blue, null),
            status: (null, null, center)
            );

$media_query: null // Making styles for all devices

@include _responsive_table($options, $styles, $media_query);

// OUTPUT
/*
    .responsive-table-name{
        // display is missing because it equals null
        color: grey;
        text-align: center;
    }

    .responsive-table-name-title{
        // display is missing because it equals null
        // color: grey; color is ignored due to "title_properties_no_show"
        text-align: center;
    }

    .responsive-table-price{
        // display is missing because it equals null
        color: grey;
        // text-align is missing because it equals null
    }

    // .responsive-table-price-title{
    //    display is missing because it equals null
    //    color is ignored due to "title_properties_no_show"
    //    text-align is missing because it equals null
    // }

    .responsive-table-status{
        // display is missing because it equals null
        // color is missing because it equals null
        text-align: center;
    }

    .responsive-table-status-title{
        // display is missing because it equals null
        // color is missing because it equals null
        text-align: center;
    }
*/

Contribute

Please file an issue if you think something could be improved. Please submit Pull Requests when ever possible.