--- layout: '@/layouts/Doc.astro' title: ASCII Boxes --- import Example from '@/components/Example.astro' import boxStyle from '@webtui/css/utils/box.css?raw' import badgeStyle from '@webtui/css/components/badge.css?raw' import buttonStyle from '@webtui/css/components/button.css?raw' The `box-` utility utilizes CSS `::before` and `::after` pseudo-elements to mimic a boxes drawn with ASCII [Box-drawing characters](https://en.wikipedia.org/wiki/Box-drawing_characters)
top-left top-right

Lorem ipsum dolor sit amet sit dolor ipsum lorem idk i dont speak french

bottom-left bottom-right
`} /> ## Import ```css @import '@webtui/css/utils/box.css'; ``` ## Usage ```html
Hi Mom
``` **Important**: The `box-` utility is **suffixed** with a `-` Using `box="..."` **will not work** ## Examples ### Border Types Square
Round
Double
Double + Round
`} /> ### Shearing Shearing off top/bottom padding allows overlaying content over the top and/or bottom edges of the box
Left Right
Caption on Top
Caption on Bottom
Left Right
Left Right
Caption on Top and Bottom
Left Right
`} /> ## Reference ### Properties - `--box-border-color`: The border color of the box - `--box-rounded-radius`: The border radius of `round` boxes - `--box-border-width`: The border width for `square` and `round` boxes - `--box-double-border-width`: The width of boxes with `double` borders ```css #my-box { --box-border-color: cyan; --box-rounded-radius: 8px; --box-border-width: 1px; --box-double-border-width: 1px; } ``` ### Extending To extend the Box stylesheet, define a CSS rule on the `utils` layer ```css @layer utils { [box-~='square'], [box-~='round'], [box-~='double'] { /* ... */ } } ```