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

nuclear-position

v1.0.1

Published

CSS position properties for Nuclearcss

Downloads

2

Readme

Nuclear css position properties

Position

Specifies the type of positioning method used for an element.

  • static - Elements render in order, as they appear in the document flow.
  • absolute - The element is positioned relative to its first positioned (not static) ancestor element.
  • fixed - The element is positioned relative to the browser window.
  • relative - The element is positioned relative to its normal position.

Note: If "position:static", the top, right, bottom and left properties have no effect. Note: A "positioned" element is one whose position is anything except static. Note: If an absolute positioned element has no positioned ancestors, it uses the document body, and moves along with page scrolling.

.pos-s { position: static; }
.pos-a { position: absolute; }
.pos-f { position: fixed; }
.pos-r { position: relative; }
<div class="pos-a">
  content
</div>

Position adjustments

  • top - Sets the top edge position in px, cm, etc.
  • right - Sets the right edge position in px, cm, etc.
  • bottom - Sets the bottom edge position in px, cm, etc.
  • left - Sets the left edge position in px, cm, etc.

Note: Negative values are allowed.

.t { top: 0; }
.r { right: 0; }
.b { bottom: 0; }
.l { left: 0; }
<div class="pos-a t r l">
  content
</div>

Floats

Specifies whether or not a box (an element) should float.

  • none - The element is not floated, this is default.
  • left - The element floats to the left.
  • right - The element floats the right.

Note: Absolutely positioned elements ignores the float property!

.fl-n { float: none; }
.fl-l { float: left; }
.fl-r { float: right; }
<div>
  <div class="fl-l">left</div>
  <div class="fl-r">right</div>
</div>

Clear

Specifies which sides elements are not allowed to float.

  • none - Default. Allows floating elements on both sides.
  • left - No floating elements allowed on the left side.
  • right - No floating elements allowed on the right side.
  • both - No floating elements allowed on either the left or the right side.
.cl-n { clear: none; }
.cl-l { clear: left; }
.cl-r { clear: right; }
.cl-b { clear: both; }
<div class="cl-b">
  <div class="fl-l">left</div>
  <div class="fl-r">right</div>
</div>

Clearfix

Fixes broken layouts when children are only floating elements.

.clfx:after {
  content: ' ';
  display: table;
  clear: both;
}
<div class="clfx">
  <div class="fl-l">left</div>
  <div class="fl-r">right</div>
</div>

Z index

Specifies the stack order of an element. An element with greater stack order is always in front of an element with a lower stack order.

  • auto - Sets the stack order equal to its parents. This is default.
  • number - Sets the stack order of the element. Negative numbers are allowed.

Note: z-index only works on positioned elements not position: static.

.z-1 { z-index: var(--z-index-1); }
.z-2 { z-index: var(--z-index-2); }
.z-3 { z-index: var(--z-index-3); }
.z-4 { z-index: var(--z-index-4); }
.z-5 { z-index: var(--z-index-5); }
<div>
  <div class="z-1">front</div>
  <div class="z-2">back</div>
</div>

Variables

:root {
  --z-index-1: 3;
  --z-index-2: 2;
  --z-index-3: 1;
  --z-index-4: 0;
  --z-index-5: -1;
}