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

postcss-arrow-boxes

v1.0.0

Published

A PostCSS plugin that will create boxes with arrows in any direction.

Downloads

82

Readme

PostCSS Arrow Boxes

PostCSS plugin that will create boxes with arrows in any direction.

It is often useful to have some content in a box and have that box have an arrow that points to something. A simple example would be an open tool tip pointing at the icon that opened the tooltip. Creating those boxes with the pointer arrows is easy with this plugin.

Example

<div class="arrow-box  arrow-box--bottom-right"></div>
/* You define properties of your box. */
.arrow-box{
    position: relative;
    display: block;
    width: 120px;
    height: 75px;
}

/* Let the plugin position the arrow. */
.arrow-box--bottom-right{
    arrow-box: bottom, left, gray, 10px;
}

Will output:

.arrow-box{
    position: relative;
    display: block;
    width: 120px;
    height: 75px;
}

.arrow-box--bottom-right{
    background-color: gray;
}

.arrow-box--bottom-right:before{
    border-top-color: gray !important;
    border: 10px solid transparent;
    position: absolute;
    top: 100%;
    border-collapse: separate;
    content: "";
    left: 10px;
}

Usage

npm install postcss-arrow-boxes --save-dev

Gulp

var postcss = require('gulp-postcss');
var arrowBoxes = require('postcss-arrow-boxes');

gulp.task('css', function () {
    var processors = [
        arrowBoxes
    ];
    return gulp.src('./src/*.css')
        .pipe(postcss(processors))
        .pipe(gulp.dest('./dest'));
});

Options

arrow-box: (side), (position), (color), (size);

side

Side can be either top, right, bottom, or left.

postion

Position options change a bit depending on what was chosen for the 'side' option. If 'side' is top or bottom position can be right, left, or center. If 'side' is left or right position can be top, bottom, or center.

color

Color can be set to any color value.

size

Size will control the size of your arrow. It should be in px.

Example

arrow-box: top, left, red, 8px;

This would place the arrow on the top side of the box on the left edge. It would be red and sized to 8px.