# basscss-positions

> CSS positioning utilities for Basscss

Latest version **1.0.5** (published 2015-12-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install basscss-positions
pnpm add basscss-positions
yarn add basscss-positions
bun add basscss-positions
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2015-12-17 |
| First published | 2014-09-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5898 |
| Author | Brent Jackson |
| Maintainers | jxnblk |

## Links

- npm: https://www.npmjs.com/package/basscss-positions
- Repository: https://github.com/basscss/basscss
- Issues: https://github.com/basscss/basscss/issues
- npm.io page: https://npm.io/package/basscss-positions

## Recent versions

- 1.0.5 (latest) — 2015-12-17
- 1.0.4 — 2015-06-29
- 1.0.3 — 2015-06-29
- 1.0.2 — 2015-06-26
- 1.0.1 — 2015-04-11
- 1.0.0 — 2015-04-10
- 0.0.6 — 2015-04-09
- 0.0.5 — 2014-12-22
- 0.0.4 — 2014-12-19
- 0.0.3 — 2014-09-29
- 0.0.2 — 2014-09-21
- 0.0.1 — 2014-09-14

## README

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

<p class="red">Use positions with caution. They are often unnecessary and commonly misused.</p>

Use `.relative` to create a new stacking context.

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

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

```html
<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.
<p class="docs-show" style="display:none">Note: fixed positioning has been disabled here for demonstration only.</p>

```html
<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.

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

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

```html
<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.

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

<style>
.MarkedExample .fixed { position: static }
</style>

---
_Source: https://npm.io/package/basscss-positions · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
