Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

basscss-position

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

basscss-position

CSS positioning utilities for Basscss

  • 2.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.9K
decreased by-53.11%
Maintainers
1
Weekly downloads
 
Created
Source

This module includes basic positioning utilities to alter the default document flow.

Use positions with caution. They are often unnecessary and commonly misused.

Use .relative to create a new stacking context.

<div class="relative">
  <button class="btn btn-primary">Button</button>
</div>

Use .absolute to move elements out of the default document flow.

<div class="relative mb4">
  <button class="btn btn-primary">Button</button>
  <div class="absolute bg-white border rounded">
    <a href="#" class="block btn">Dropdown Action</a>
    <a href="#" class="block btn">Action</a>
    <a href="#" class="block btn">Action</a>
  </div>
</div>

Use .fixed to position an element relative to the viewport.

Note: fixed positioning has been disabled here for demonstration only.

<button class="fixed btn btn-primary">
  Button
</button>

Note: Fixed positioning is notoriously tricky to use well and can lead to inaccessible content and unwanted side effects. Use fixed positioning with caution.

To anchor to a particular side, use .top-0, .right-0, .bottom-0, or .left-0. Margin and padding utilities can be used to space elements apart.

<button class="fixed top-0 right-0 m2 btn btn-primary">
  Button
</button>

To fill an entire width or height, use opposing directions.

<div class="fixed top-0 left-0 right-0 p2 white bg-black">
  Fixed bar
</div>

To ensure the desired stacking order, use z-index utilities.

<div class="fixed z2 top-0 left-0 right-0 p2 white bg-black">
  Fixed bar
</div>
.MarkedExample .fixed { position: static }

FAQs

Package last updated on 18 Dec 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc