Skip to content

Latest commit

 

History

History
38 lines (25 loc) · 722 Bytes

README.md

File metadata and controls

38 lines (25 loc) · 722 Bytes

Luna Box Model

Css box model metrics.

Demo

https://luna.liriliri.io/?path=/story/box-model

Install

Add the following script and style to your page.

<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/luna-box-model/luna-box-model.css" />
<script src="//cdn.jsdelivr.net/npm/luna-box-model/luna-box-model.js"></script>

You can also get it on npm.

npm install luna-box-model --save
import 'luna-box-model/luna-box-model.css'
import LunaBoxModel from 'luna-box-model'

Usage

const boxModel = new LunaBoxModel(container)
boxModel.setOption('element', document.getElementById('target'))

Configuration

  • element(HTMLElement): Target element.