<dfnid="dfn-bluelib">Bluelib</dfn> is a modular <i>CSS</i> library for web pages which aims to provide <b>great customization</b> and <b>flexibility</b> while trying to keep <b>HTML as "basic" as possible</b>.
</p>
<p>
This page itself acts both as a <b>documentation</b> of the library and as a <b>live preview</b> of its capabilities.
</p>
<p>
If you're on a browser which supports that, you can right click any element of this page and then click <kbd>Inspect Element</kbd> to see how something is done.
</p>
<divclass="panel parenthesis float-bottom">
<p>
This page is also used for development, therefore it uses un-minified sources and imports some development scripts.
</p>
<p>
Do not try to determine the performance of Bluelib from this page, as the development features are somewhat heavy on the browser!
</p>
</div>
</section>
</div>
<divclass="chapter-2">
<sectionclass="panel box"id="panel-index">
<h3>
Table of contents
</h3>
<ol>
<li><ahref="#chapter-welcome">Welcome to Bluelib!</a></li>
A Bluelib <dfnid="dfn-target">target</dfn> is a CSS document where CSS rulesets of a certain type are grouped together.
</p>
<p>
It is composed by two parts: the <dfnid="dfn-ruleset">ruleset</dfn>, determining the CSS rules to use, and the <dfnid="dfn-selectorset">selectorset</dfn>, determining the elements to apply the CSS rules on.
</p>
<hr/>
<p>
<i>Targets</i> always have a predictable name, which is:
By running <code>dist/_build.sh</code>, new targets are generated and compiled from <ahref="https://lesscss.org/">Less</a> to CSS.
</p>
<p>
The <ahref="https://en.wikipedia.org/wiki/Cartesian_product">cartesian product</a> is applied between all <i>rulesets</i> in <code>src/rulesets</code> and all <i>selectorsets</i> in <code>src/selectorsets</code>, compiling a new target for each pair.
<dt><labelclass="fade"><inputtype="radio"disabledcheckedclass="ruleset-toggle"name="ruleset-colors"onclick="selectColor('less:bluelib-dist-colors-royalblue:root', 'fabrice-nerfin-puHQJZd3MDg-unsplash.jpg')"> Royal Blue</label></dt>
All selectors use class names, allowing the usage of the target with <ahref="https://github.com/css-modules/css-modules">CSS Modules</a>. Useful for React or similar web app projects.
</dd>
</dl>
</section>
</div>
<divclass="chapter-3"id="chapter-install">
<h2>
Installation and usage
</h2>
<sectionclass="panel box"id="panel-unpkg">
<h3>
Via UNPKG
</h3>
<p>
The easiest way to use Bluelib on your website is by using <ahref="https://unpkg.com/">UNPKG</a>.
</p>
<p>
Simply link the stylesheets in the header of your project like this:
A <dfnid="dfn-panel">Panel</dfn> is a <b>container</b> styled with a <b>slight background color</b> and no borders.
</p>
<divclass="panel float-bottom">
Hello world! I am a Panel!
</div>
</section>
<sectionclass="panel box"id="panel-box">
<h3>
Box
</h3>
<p>
A <dfnid="dfn-box">Box</dfn> is a <b>container</b> adding <b>borders of all four sides</b> to the base appearence of a Panel.
</p>
<divclass="panel box float-bottom">
This Box contains a hidden Snake. <spanstyle="display: none;">🐍</span>
</div>
</section>
<sectionclass="panel box"id="panel-dialog">
<h3>
Dialog
</h3>
<p>
A <dfnid="dfn-dialog">Dialog</dfn> is a <b>container</b> adding a <b>left border</b> to the base appearence of a Panel.
</p>
<blockquoteclass="panel dialog float-bottom">
<q>Snake? Snake??? SNAKEEEEEEE!</q>
</blockquote>
</section>
<sectionclass="panel box"id="panel-parenthesis">
<h3>
Parenthesis
</h3>
<p>
A <dfnid="dfn-parenthesis">Parenthesis</dfn> is a <b>container</b> styled as a Panel and with smaller text.
</p>
<divclass="panel parenthesis float-bottom">
I think we lost the Snake...
</div>
</section>
<sectionclass="panel box"id="panel-when-panel">
<h3>
Panel usage
</h3>
<p>
When using Bluelib, text should always be either an <b>header</b> or <b>inside a <i>Panel</i></b>.
</p>
<p>
Since <i>Panels</i> often denote "sections" of text, they should usually be <b><code><section></code> elements</b>.
</p>
<p>
When they are only used cosmetically, <b><code><div></code> elements</b> should be used instead.
</p>
<p>
When used to create forms, they may also be <b><code><form></code> elements</b>.
</p>
</section>
<sectionclass="panel box"id="panel-when-box">
<h3>
Box usage
</h3>
<p>
A <i>Box</i> creates a visible <b>separation</b> between the <b>content inside it</b> and the <b>content outside it</b>, and should be used when this separation is desired, like when <b>describing a topic</b> (like here).
</p>
<p>
To achieve the best visual style, <i>Boxes</i> should always be the outmost panels: you should <b><em>never</em> place a <i>Box</i> inside a Panel or a Dialog</b>, but you can place one inside another <i>Box</i>.
</p>
</section>
<sectionclass="panel box"id="panel-when-dialog">
<h3>
Dialog usage
</h3>
<p>
A <i>Dialog</i> creates a visible <b>indentation</b> of the <b>content inside it</b>, and should be used when this indentation is desired, like in <b>quotes</b> or <b>examples</b>.
</p>
<p>
When containing a quote, they should use <b><code><blockquote></code> elements</b>.
</p>
<p>
Like Boxes, <i>Dialogs</i> should <b><em>never</em></b> be placed <b>into containers with less borders</b> than them, such as Panels.
A <i>Parenthesis</i><b>removes importance from its contents</b>, and therefore makes for a great container for notes or additional information about a topic.
</p>
<p>
Having no borders, they should be considered as Panels when placing them: never add Boxes or Dialogs inside them.
</p>
</section>
</div>
<divclass="chapter-2">
<sectionclass="panel box"id="panel-nesting">
<h3>
Nesting
</h3>
<p>
As you have seen in the sections before, panels can be <b>nested</b> many times (until the text becomes undistinguishable)!
A <dfnid="dfn-chapter">chapter</dfn> is a grouping of an heading and multiple panels containing tightly related information.
</p>
<p>
They split their children into a preset amount of columns: this one, for example, splits panels <b>into two columns</b>.
</p>
<p>
The maximum number of columns in a chapter is 9; beyond that, you'll need to write your own chapter code.
</p>
</section>
<sectionclass="panel box"id="panel-panelheights">
<h3>
Panel heights
</h3>
<p>
In a chapter, all panels on a row <b>inherit the height of the tallest panel in it</b>, so that no empty space is left.
</p>
</section>
<sectionclass="panel box"id="panel-float">
<h3>
Element floats
</h3>
<p>
A <dfnid="dfn-float">float</dfn> is a utility class to align items in panels without having to write CSS.
</p>
<pclass="float-bottom">
For example, if a panel has some empty space, elements can be made to <b>float to the bottom</b>, which can be useful for example for buttons in sibling panels.
</p>
</section>
<sectionclass="panel box"id="panel-autowrap">
<h3>
Auto-wrapping
</h3>
<p>
Panels in a numbered chapter will <b>automatically wrap</b> if their contents won't fit horizontally.
</p>
<p>
Wrapped panels' heights ignore the height of panels in other rows.
</p>
<pclass="float-bottom">
To have a constant height, one has to be set manually.
</p>
</section>
<sectionclass="panel box"id="panel-autosizing">
<h3>
Auto-sizing
</h3>
<p>
Panels in a "zero" chapter will instead <b>automatically resize</b> to fit everything in a single row.
To set a constant width, one has to be set manually.
</p>
</section>
</div>
<divclass="chapter-3"id="chapter-modifiers">
<h2>
Modifiers
</h2>
<sectionclass="panel box"id="panel-fade">
<h3>
Fade
</h3>
<p>
The <dfnid="dfn-fade">fade</dfn> modifier <b>reduces the opacity</b> of the elements it is applied to.
</p>
<divclass="panel box fade float-bottom">
<p>
I'm a faded box!
</p>
<divclass="panel box">
<p>
I'm faded too!
</p>
<divclass="panel box fade">
<p>
But they can be faded <b>more</b>.
</p>
</div>
</div>
</div>
</section>
<sectionclass="panel box"id="panel-mark">
<h3>
Mark
</h3>
<p>
The <dfnid="dfn-mark">mark</dfn> modifier <b>distinguishes</b> the elements it is applied to from the surrounding ones by applying a <b>strong color contrast</b>.
A <dfnid="dfn-separator-light">light separator</dfn> is a <b>less eye-catching separator</b>, to be used if the regular separator distracts too much from the flow of the text.
A <dfnid="dfn-separator-heavy">heavy separator</dfn> is a <b>very eye-catching separator</b>, to be used if the regular separator isn't apparent enough.
</p>
<hrclass="separator-heavy float-bottom">
<blockquoteclass="panel dialog">
Bottom Text 2: Electric Boogaloo
</blockquote>
</section>
</div>
<divclass="chapter-2"id="chapter-lists">
<h2>
Lists
</h2>
<sectionclass="panel box"id="panel-list-ordered">
<h3>
Ordered list
</h3>
<p>
A <dfnid="dfn-list-ordered">ordered list</dfn> displays a series of items whose order is relevant.
A <dfnid="dfn-list-definition">definition list</dfn> displays a series of term-description pairs.
</p>
<dl>
<dt>
Term
</dt>
<dd>
Description
</dd>
<dt>
Other term
</dt>
<dd>
Other description
</dd>
</dl>
</section>
<sectionclass="panel box"id="panel-details">
<h3>
Collapsible details
</h3>
<p>
A <dfnid="dfn-details">details</dfn> element <b>hides its contents</b>, displaying only a <dfnid="dfn-summary">summary</dfn> until either the marker or the summary itself <b>is activated</b>.
</p>
<details>
<summary>Something</summary>
<p>
Something else
</p>
</details>
<details>
<summary>Something more</summary>
<p>
Something different
</p>
</details>
</section>
</div>
<divclass="chapter-1"id="chapter-text">
<h2>
Text elements
</h2>
<sectionclass="panel box"id="panel-anchor">
<h3>
<u>A</u>nchors
</h3>
<p>
An <dfnid="dfn-anchor">anchor</dfn> is an interactable element which can be clicked to <b>go to a different page</b>, or a <b>different part of the same page</b>, or to <b>perform an action with a different application</b>!
</p>
<divclass="panel">
<p>
Do you want to <ahref="https://example.org/">go to example.org</a>?
</p>
<p>
Or perhaps to <ahref="#chapter-glossaries">the chapter about glossaries</a>?
</p>
<p>
Or perhaps to <ahref="magnet:?xt=urn:btih:dd8255ecdc7ca55fb0bbf81323d87062db1f6d1c&dn=Big+Buck+Bunny&tr=udp%3A%2F%2Fexplodie.org%3A6969&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.empire-js.us%3A1337&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2F&xs=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2Fbig-buck-bunny.torrent">download Big Buck Bunny</a> with a torrent client?
</p>
</div>
</section>
</div>
<divclass="chapter-4">
<sectionclass="panel box"id="panel-idiomatic">
<h3>
<u>I</u>diomatic expressions
</h3>
<p>
An <dfnid="dfn-idiomatic">idiomatic expression</dfn> should be used when a <b>domain-specific term</b> is used.
</p>
<divclass="panel float-bottom">
<p>
This is an <i>idiomatic expression</i>.
</p>
</div>
</section>
<sectionclass="panel box"id="panel-emphasis">
<h3>
<u>Em</u>phasis
</h3>
<p>
An <dfnid="dfn-emphasis">emphasis</dfn> should be used when a certain word should be <b>stressed more</b> than the others in a text.
</p>
<divclass="panel float-bottom">
<p>
You're doing <em>what</em>?!
</p>
</div>
</section>
<sectionclass="panel box"id="panel-attention">
<h3>
<u>B</u>ring attention
</h3>
<p>
An <dfnid="dfn-attention">attention-bringer</dfn> element denotes parts of text as <b>more important</b> than the others.
</p>
<divclass="panel float-bottom">
<p>
I used attention-bringers basically <b>everywhere in this page</b>.
</p>
</div>
</section>
<sectionclass="panel box"id="panel-strong">
<h3>
<u>Strong</u> importance
</h3>
<p>
A <dfnid="dfn-strong">strong importance</dfn> element denotes parts of text that are <b>even more important</b> than the ones denoted by <i>attention-bringers</i>.
</p>
<divclass="panel float-bottom">
<p>
Pls <strong>notice me</strong> senpai!!1!
</p>
</div>
</section>
<sectionclass="panel box"id="panel-annotation">
<h3>
<u>U</u>narticulated annotations
</h3>
<p>
An <dfnid="dfn-annotation">unarticulated annotation</dfn> denotes parts of text that were given an <b>annotation</b> without any comment.
</p>
<divclass="panel float-bottom">
<p>
Just look at the <u>h</u>eaders of level <u>3</u> of these panels!
</p>
</div>
</section>
<sectionclass="panel box"id="panel-strike">
<h3>
<u>S</u>trike
</h3>
<p>
A <dfnid="dfn-strike">strike</dfn> marks a part of text as <b>incorrect</b>.
</p>
<divclass="panel float-bottom">
<p>
I'm <s>plotting to conquer the world</s> completely innocent and not an evil villain!
</p>
</div>
</section>
<sectionclass="panel box"id="panel-insdel">
<h3>
<u>Ins</u>erted and <u>del</u>eted text
</h3>
<p>
When comparing changes to a text, parts of it can be marked as <dfnid="dfn-inserted">inserted</dfn> or <dfnid="dfn-deleted">deleted</dfn>.
</p>
<divclass="panel float-bottom">
<h4style="text-align: left;">
Bluelib 5.0.0
</h4>
<ul>
<li>Added: <ins>more bugs</ins></li>
<li>Removed: <del>cool features</del></li>
</ul>
</div>
</section>
<sectionclass="panel box"id="panel-small">
<h3>
<u>Small</u> comment
</h3>
<p>
A <dfnid="dfn-small">small comment</dfn> element denotes a part of a text as less important than the others.
</p>
<p>
It can be considered the opposite of <i>attention-bringers</i>, and similar to the <i>parenthesis</i> panel.
</p>
<divclass="panel float-bottom">
<p>
Bluelib is great! <small>I'm joking, of course.</small>
</p>
</div>
</section>
<sectionclass="panel box"id="panel-preformatted">
<h3>
<u>Pre</u>formatted text
</h3>
<p>
A <dfnid="dfn-preformatted">preformatted text</dfn> element denotes text where <b>lines and positioning are significant</b>; this prevents them from being <b>rearranged</b> by the browser.
</p>
<p>
It should be used for <b>poetry</b>, <b>code</b>, <b>ASCII art</b>, <b>kaomoji</b>, etc.
</p>
<divclass="panel float-bottom">
<pre> mm mmmm mmm mmmmm mmmmm
## #" " m" " # #
# # "#mmm # # #
#mm# "# # # #
# # "mmm#" "mmm" mm#mm mm#mm</pre>
</div>
</section>
<sectionclass="panel box"id="panel-code">
<h3>
Code
</h3>
<p>
A <dfnid="dfn-code">code</dfn> element denotes that its contents are some kind of <b>code</b> (probably belonging to a programming language).
</p>
<p>
If displayed as a block instead of inline, it should be used with a <i>preformatted text</i> element.
</p>
<divclass="panel float-bottom">
<p>
How to create a <code>section.panel</code> with Bluelib:
</p>
<pre><code><div class="panel">
<p>
Contents
</p>
</div></code></pre>
</div>
</section>
<sectionclass="panel box"id="panel-sample">
<h3>
Sample input and output
</h3>
<p>
<dfnid="dfn-sample-input">Input samples</dfn> and <dfnid="dfn-sample-output">output samples</dfn> from a computer have elements which denote them, and are formatted appropriately.
</p>
<p>
A <i>sample</i> inside another creates emphasises the individual element, creating a combination.
</p>
<divclass="panel float-bottom">
<p>
If you press <kbd><kbd>Ctrl</kbd>+<kbd>Alt</kbd>+<kbd>Del</kbd></kbd>, something will happen!
</p>
<p>
If you're on Windows, a menu will appear, and one of the options will say <samp>Task Manager</samp>.
</p>
</div>
</section>
<sectionclass="panel box"id="panel-variable">
<h3>
Variables
</h3>
<p>
A <dfnid="dfn-variable">variable</dfn> denotes a placeholder for something in a formula or algorithm.
A <dfnid="dfn-quote">quote</dfn> element indicates an <b>inline quote</b>, and may be optionally include a <dfnid="dfn-citation">citation</dfn> element indicating the <b>source of the quote</b>.
</p>
<divclass="panel dialog float-bottom">
<p>
<q>Objection!</q><br/>
—<cite>Phoenix Wright</cite>, Ace Attorney
</p>
</div>
</section>
<sectionclass="panel box"id="panel-definition">
<h3>
Definitions
</h3>
<p>
A <dfnid="dfn-definition">definition</dfn> element indicates the <b>term that is being defined</b> in the contained paragraph.
</p>
<divclass="panel float-bottom">
<p>
This <dfn>definition example</dfn> is getting a bit too <i>meta</i> for my tastes.
</p>
</div>
</section>
<sectionclass="panel box"id="panel-abbreviation">
<h3>
Abbreviations
</h3>
<p>
An <dfnid="dfn-abbreviation">abbreviation</dfn> element marks its contents as an <b>acronym</b> or <b>abbreviation</b> and allows the user to view the expanded abbreviation by hovering it with the mouse.
</p>
<p>
Note that no mobile browsers currently support this feature, so you'll have to <b>manually provide an alternative</b> for mobile users to see the full abbreviation.
</p>
<divclass="panel float-bottom">
<p>
Two companies against each other: <abbrclass="blue"title="Builders League United">BLU</abbr> vs. <abbrclass="red"title="Reliable Excavation Demolition">RED</abbr>!
</p>
</div>
</section>
<sectionclass="panel box"id="panel-ruby">
<h3>
Ruby
</h3>
<p>
A <dfnid="dfn-ruby">ruby text</dfn> element is <b>text with small annotations above</b>, commonly used in East Asian texts.
</p>
<divclass="panel float-bottom">
<pstyle="font-size: xx-large;">
<ruby>
Mo <rp>/</rp><rt>ˈmɒ</rt><rp>/</rp>
de <rp>/</rp><rt>dɪ</rt><rp>/</rp>
na <rp>/</rp><rt>nə</rt><rp>/</rp>
</ruby>
</p>
<pstyle="font-size: xx-large;">
<ruby>
漢 <rp>(</rp><rt>kan</rt><rp>)</rp>
字 <rp>(</rp><rt>ji</rt><rp>)</rp>
</ruby>
</p>
<pstyle="font-size: xx-large;">
<ruby>
明日 <rp>(</rp><rt>ashita</rt><rp>)</rp>
</ruby>
</p>
</div>
</section>
</div>
<divclass="chapter-2"id="chapter-tables">
<h2>
Tables
</h2>
<sectionclass="panel box"id="panel-table">
<h3>
Table
</h3>
<p>
A <dfnid="dfn-table">table</dfn> is an element whose children are aligned in a grid.
A <i>Field</i> may require a particular <ahref="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#type">type</a> of data, such as an email or a phone number.
A <dfnid="dfn-multiselect">Multiselect</dfn> is an <i>Input</i> which allows the user to <b>enable or disable multiple options</b>.
</p>
<p>
Be aware that the average user will probably not know how to interact with the <i>Multiselect</i>: to select options not adjacent to each other on a desktop browser, it requires holding the <kbd>Ctrl</kbd> key.
<dfnid="dfn-radio">Radios</dfn> are <i>Input</i>s which, like a <i>Select</i>, allow the user to select between <b>one of multiple options</b> when grouped together.
<dfnid="dfn-checkbox">Checkboxes</dfn> are <i>Input</i>s which, like a <i>Multiselect</i>, allows the user to <b>enable or disable multiple options</b> when grouped together.