# format-css-grid

> Opinionated formatting utilities for CSS Grid.

Latest version **0.1.0** (published 2021-12-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install format-css-grid
pnpm add format-css-grid
yarn add format-css-grid
bun add format-css-grid
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2021-12-13 |
| First published | 2021-12-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >= 12 |
| Dependencies | 1 |
| Unpacked size | 22.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Aaron Casanova |
| Maintainers | aaronccasanova |

## Links

- npm: https://www.npmjs.com/package/format-css-grid
- Repository: https://github.com/aaronccasanova/format-css-grid
- Homepage: https://github.com/aaronccasanova/format-css-grid#readme
- Issues: https://github.com/aaronccasanova/format-css-grid/issues
- npm.io page: https://npm.io/package/format-css-grid

## Dependencies (1)

- [postcss-value-parser](https://npm.io/package/postcss-value-parser.md) ^4.2.0

## Recent versions

- 0.1.0 (latest) — 2021-12-13
- 0.0.3 — 2021-12-13
- 0.0.2 — 2021-12-13

## README

# Format CSS Grid

Opinionated formatting utilities for CSS Grid.

## Installation

```sh
npm i format-css-grid
```

## Usage

Parse and format a CSS `grid-template-areas` declaration value into an array of grid area rows.

```ts
import { formatGridTemplateAreas } from 'format-css-grid'

const gridTemplateAreas = formatGridTemplateAreas('"aa b" "c dd"')
// => ["aa b ",
//     "c  dd"]
```

Format a CSS `grid-template-areas` declaration value.

```ts
interface GetGridTemplateAreasOptions {
  /** `grid-template-areas` value. */
  value: string
  /**
   * Start column of the `grid-template-areas` property name.
   */
  startColumn?: number
  /**
   * Number of spaces to use for indenting rows.
   * @default 2
   */
  tabWidth?: number
  /**
   * Convert `grid-template-areas` value to use single quotes.
   * @default false
   */
  singleQuote?: boolean
  /**
   * Use tabs for indenting rows.
   * @default false
   */
  useTabs?: boolean
}

import { getGridTemplateAreas } from 'format-css-grid'

const gridTemplateAreas = formatGridTemplateAreas({
  value: '"aa b" "c dd"',
  tabWidth: 2,
})
// => '\n  "aa b "\n  "c  dd"'
```

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