diff --git a/LICENSE.txt b/LICENSE.txt index 0ad25db..40a3d6a 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -319,7 +319,7 @@ requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and +adversely affects the operation of the network or violates the rulesets and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, diff --git a/dist/_build.sh b/dist/_build.sh index 9de5459..b69aa29 100755 --- a/dist/_build.sh +++ b/dist/_build.sh @@ -7,14 +7,14 @@ echo "Mixins:" echo "$mixins" echo -echo "Finding rules..." -rules=$(ls ../src/rules/*.less ../src/rules/**/*.less) +echo "Finding rulesets..." +rules=$(ls ../src/rulesets/*.less ../src/rulesets/**/*.less) echo "Rules:" echo "$rules" echo echo "Finding selectors..." -selectors=$(ls ../src/selectors/*.less ../src/selectors/**/*.less) +selectors=$(ls ../src/selectorsets/*.less ../src/selectorsets/**/*.less) echo "Selectors:" echo "$selectors" echo diff --git a/dist/base.module.css b/dist/base.module.css index 666b1d3..78f46f1 100644 --- a/dist/base.module.css +++ b/dist/base.module.css @@ -631,10 +631,11 @@ display: flex; gap: 1ex; } -.bluelib .form-flex > .element-label > .element-span:first-child, -.bluelib .form-flex > .element-label > .element-span:last-child { +.bluelib .form-flex > .element-label > *:first-child, +.bluelib .form-flex > .element-label > *:last-child { margin: auto 0; flex-basis: 15%; + flex-grow: 0; font-style: var(--bfont-label-style); font-variant: var(--bfont-label-variant); font-weight: var(--bfont-label-weight); @@ -645,14 +646,20 @@ --bhsl-current-saturation: var(--bhsl-primary-saturation); --bhsl-current-lightness: var(--bhsl-primary-lightness); } -.bluelib .form-flex > .element-label > .element-span:first-child { - text-align: right; -} -.bluelib .form-flex > .element-label > .element-span:last-child { - text-align: left; -} -.bluelib .form-flex > .element-label > .input { +.bluelib .form-flex > .element-label > * { flex-grow: 1; + display: flex; + justify-content: start; + align-items: center; + gap: 4px; +} +.bluelib .form-flex > .element-label > *:first-child { + text-align: right; + display: block; +} +.bluelib .form-flex > .element-label > *:last-child { + text-align: left; + display: block; } .bluelib .text-anchor { --bhsl-current-hue: var(--bhsl-link-hue); diff --git a/dist/base.module.less b/dist/base.module.less index 64850ba..43dede2 100644 --- a/dist/base.module.less +++ b/dist/base.module.less @@ -3,8 +3,8 @@ @import (less) "../src/mixins/hsl.less"; // Selector -@import (less) "../src/selectors/module.less"; +@import (less) "../src/selectorsets/module.less"; // Rule -@import (less) "../src/rules/base.less"; +@import (less) "../src/rulesets/base.less"; diff --git a/dist/base.root.css b/dist/base.root.css index 6213b12..c9c98ce 100644 --- a/dist/base.root.css +++ b/dist/base.root.css @@ -103,27 +103,27 @@ body .panel { background-color: hsl(var(--bhsl-background-hue) var(--bhsl-background-saturation) var(--bhsl-background-lightness)); } body .panel.border-top, -body .panel.panel-box { +body .panel.box { border-top-width: 2px; padding-top: calc(0.5em - 2px); } body .panel.border-right, -body .panel.panel-box { +body .panel.box { border-right-width: 2px; padding-right: calc(0.5em - 2px); } body .panel.border-left, -body .panel.panel-box, -body .panel.panel-dialog { +body .panel.box, +body .panel.dialog { border-left-width: 2px; padding-left: calc(0.5em - 2px); } body .panel.border-bottom, -body .panel.panel-box { +body .panel.box { border-bottom-width: 2px; padding-bottom: calc(0.5em - 2px); } -body .panel.panel-parenthesis { +body .panel.parenthesis { font-size: smaller; } body .chapter-0, @@ -321,39 +321,39 @@ body table.panel caption *:first-child { body table.panel caption *:last-child { margin-bottom: 0; } -body table.panel-box tr { +body table.box tr { border-width: 1px; } -body table.panel-box th, -body table.panel-box td { +body table.box th, +body table.box td { border-width: 1px; padding: 7px; } -body table.panel-box caption { +body table.box caption { border-width: 2px; padding: 6px; } -body table.panel-box caption.table-caption-top { +body table.box caption.table-caption-top { border-bottom-width: 0; } -body table.panel-box caption.table-caption-bottom { +body table.box caption.table-caption-bottom { border-top-width: 0; } -body table.panel-dialog thead > tr { +body table.dialog thead > tr { border-bottom-width: 1px; } -body table.panel-dialog tbody > tr { +body table.dialog tbody > tr { border-width: 0; } -body table.panel-dialog tfoot > tr { +body table.dialog tfoot > tr { border-top-width: 1px; } -body table.panel-dialog th, -body table.panel-dialog td { +body table.dialog th, +body table.dialog td { border-width: 0 0 0 1px; padding: 8px 8px 8px 7px; } -body table.panel-dialog caption { +body table.dialog caption { border-width: 0 0 0 2px; padding: 8px 8px 8px 6px; } @@ -675,10 +675,11 @@ body .form-flex > label { display: flex; gap: 1ex; } -body .form-flex > label > span:first-child, -body .form-flex > label > span:last-child { +body .form-flex > label > *:first-child, +body .form-flex > label > *:last-child { margin: auto 0; flex-basis: 15%; + flex-grow: 0; font-style: var(--bfont-label-style); font-variant: var(--bfont-label-variant); font-weight: var(--bfont-label-weight); @@ -689,17 +690,20 @@ body .form-flex > label > span:last-child { --bhsl-current-saturation: var(--bhsl-primary-saturation); --bhsl-current-lightness: var(--bhsl-primary-lightness); } -body .form-flex > label > span:first-child { - text-align: right; -} -body .form-flex > label > span:last-child { - text-align: left; -} -body .form-flex > label > input, -body .form-flex > label textarea, -body .form-flex > label select, -body .form-flex > label button { +body .form-flex > label > * { flex-grow: 1; + display: flex; + justify-content: start; + align-items: center; + gap: 4px; +} +body .form-flex > label > *:first-child { + text-align: right; + display: block; +} +body .form-flex > label > *:last-child { + text-align: left; + display: block; } body a { --bhsl-current-hue: var(--bhsl-link-hue); diff --git a/dist/base.root.less b/dist/base.root.less index f76abbf..520aa51 100644 --- a/dist/base.root.less +++ b/dist/base.root.less @@ -3,8 +3,8 @@ @import (less) "../src/mixins/hsl.less"; // Selector -@import (less) "../src/selectors/root.less"; +@import (less) "../src/selectorsets/root.less"; // Rule -@import (less) "../src/rules/base.less"; +@import (less) "../src/rulesets/base.less"; diff --git a/dist/classic.module.less b/dist/classic.module.less index f5cb986..d9958ea 100644 --- a/dist/classic.module.less +++ b/dist/classic.module.less @@ -3,8 +3,8 @@ @import (less) "../src/mixins/hsl.less"; // Selector -@import (less) "../src/selectors/module.less"; +@import (less) "../src/selectorsets/module.less"; // Rule -@import (less) "../src/rules/classic.less"; +@import (less) "../src/rulesets/classic.less"; diff --git a/dist/classic.root.css b/dist/classic.root.css index db19528..47c80fc 100644 --- a/dist/classic.root.css +++ b/dist/classic.root.css @@ -98,7 +98,7 @@ body table.panel > caption { border-radius: 0; box-shadow: 0.0625em 0 0.25em hsl(var(--bhsl-background-hue) var(--bhsl-background-saturation) var(--bhsl-background-lightness)); } -body table.panel-dialog > caption { +body table.dialog > caption { border-bottom-width: 2px; } body input, diff --git a/dist/classic.root.less b/dist/classic.root.less index cca53a0..4fc0cb2 100644 --- a/dist/classic.root.less +++ b/dist/classic.root.less @@ -3,8 +3,8 @@ @import (less) "../src/mixins/hsl.less"; // Selector -@import (less) "../src/selectors/root.less"; +@import (less) "../src/selectorsets/root.less"; // Rule -@import (less) "../src/rules/classic.less"; +@import (less) "../src/rulesets/classic.less"; diff --git a/dist/colors-amber.module.less b/dist/colors-amber.module.less index 2cce788..e5ae6e7 100644 --- a/dist/colors-amber.module.less +++ b/dist/colors-amber.module.less @@ -3,8 +3,8 @@ @import (less) "../src/mixins/hsl.less"; // Selector -@import (less) "../src/selectors/module.less"; +@import (less) "../src/selectorsets/module.less"; // Rule -@import (less) "../src/rules/colors/colors-amber.less"; +@import (less) "../src/rulesets/colors/colors-amber.less"; diff --git a/dist/colors-amber.root.less b/dist/colors-amber.root.less index eec105e..4efeba4 100644 --- a/dist/colors-amber.root.less +++ b/dist/colors-amber.root.less @@ -3,8 +3,8 @@ @import (less) "../src/mixins/hsl.less"; // Selector -@import (less) "../src/selectors/root.less"; +@import (less) "../src/selectorsets/root.less"; // Rule -@import (less) "../src/rules/colors/colors-amber.less"; +@import (less) "../src/rulesets/colors/colors-amber.less"; diff --git a/dist/colors-royalblue.module.less b/dist/colors-royalblue.module.less index 7279a9b..2ffd485 100644 --- a/dist/colors-royalblue.module.less +++ b/dist/colors-royalblue.module.less @@ -3,8 +3,8 @@ @import (less) "../src/mixins/hsl.less"; // Selector -@import (less) "../src/selectors/module.less"; +@import (less) "../src/selectorsets/module.less"; // Rule -@import (less) "../src/rules/colors/colors-royalblue.less"; +@import (less) "../src/rulesets/colors/colors-royalblue.less"; diff --git a/dist/colors-royalblue.root.less b/dist/colors-royalblue.root.less index 525a01c..f0cba50 100644 --- a/dist/colors-royalblue.root.less +++ b/dist/colors-royalblue.root.less @@ -3,8 +3,8 @@ @import (less) "../src/mixins/hsl.less"; // Selector -@import (less) "../src/selectors/root.less"; +@import (less) "../src/selectorsets/root.less"; // Rule -@import (less) "../src/rules/colors/colors-royalblue.less"; +@import (less) "../src/rulesets/colors/colors-royalblue.less"; diff --git a/dist/fonts-fira-ghpages.module.less b/dist/fonts-fira-ghpages.module.less index 9982f86..441c689 100644 --- a/dist/fonts-fira-ghpages.module.less +++ b/dist/fonts-fira-ghpages.module.less @@ -3,8 +3,8 @@ @import (less) "../src/mixins/hsl.less"; // Selector -@import (less) "../src/selectors/module.less"; +@import (less) "../src/selectorsets/module.less"; // Rule -@import (less) "../src/rules/fonts/fonts-fira-ghpages.less"; +@import (less) "../src/rulesets/fonts/fonts-fira-ghpages.less"; diff --git a/dist/fonts-fira-ghpages.root.less b/dist/fonts-fira-ghpages.root.less index 3fd7243..ec6b679 100644 --- a/dist/fonts-fira-ghpages.root.less +++ b/dist/fonts-fira-ghpages.root.less @@ -3,8 +3,8 @@ @import (less) "../src/mixins/hsl.less"; // Selector -@import (less) "../src/selectors/root.less"; +@import (less) "../src/selectorsets/root.less"; // Rule -@import (less) "../src/rules/fonts/fonts-fira-ghpages.less"; +@import (less) "../src/rulesets/fonts/fonts-fira-ghpages.less"; diff --git a/dist/fun.module.less b/dist/fun.module.less index 7a661c7..07579a7 100644 --- a/dist/fun.module.less +++ b/dist/fun.module.less @@ -3,8 +3,8 @@ @import (less) "../src/mixins/hsl.less"; // Selector -@import (less) "../src/selectors/module.less"; +@import (less) "../src/selectorsets/module.less"; // Rule -@import (less) "../src/rules/fun.less"; +@import (less) "../src/rulesets/fun.less"; diff --git a/dist/fun.root.less b/dist/fun.root.less index 428d98b..01bb3d6 100644 --- a/dist/fun.root.less +++ b/dist/fun.root.less @@ -3,8 +3,8 @@ @import (less) "../src/mixins/hsl.less"; // Selector -@import (less) "../src/selectors/root.less"; +@import (less) "../src/selectorsets/root.less"; // Rule -@import (less) "../src/rules/fun.less"; +@import (less) "../src/rulesets/fun.less"; diff --git a/dist/glass.module.less b/dist/glass.module.less index fd7d168..48d01b7 100644 --- a/dist/glass.module.less +++ b/dist/glass.module.less @@ -3,8 +3,8 @@ @import (less) "../src/mixins/hsl.less"; // Selector -@import (less) "../src/selectors/module.less"; +@import (less) "../src/selectorsets/module.less"; // Rule -@import (less) "../src/rules/glass.less"; +@import (less) "../src/rulesets/glass.less"; diff --git a/dist/glass.root.less b/dist/glass.root.less index 197f565..984fdd2 100644 --- a/dist/glass.root.less +++ b/dist/glass.root.less @@ -3,8 +3,8 @@ @import (less) "../src/mixins/hsl.less"; // Selector -@import (less) "../src/selectors/root.less"; +@import (less) "../src/selectorsets/root.less"; // Rule -@import (less) "../src/rules/glass.less"; +@import (less) "../src/rulesets/glass.less"; diff --git a/examples/index.html b/examples/index.html index 0638c9d..a06f5f9 100644 --- a/examples/index.html +++ b/examples/index.html @@ -29,11 +29,11 @@

Bluelib

-
+

Welcome to Bluelib!

-
+

What is Bluelib?

@@ -48,66 +48,223 @@

- This page is also used for development, therefore it uses un-minified sources and imports many development scripts. + This page is also used for development, therefore it uses un-minified sources and imports some development scripts.

- Do not judge the library efficiency from this page, or perform any benchmarks on it, as they will probably be wrong! + Do not try to determine the performance of Bluelib from this page, as the development features are somewhat heavy on the browser!

-
+
+
+

- Rulesets + Table of contents

-

- Bluelib splits its features into rulesets, which can be enabled and disabled in this preview via the following form. -

-
- - - - - -
+
    +
  1. Welcome to Bluelib!
  2. +
  3. Rulesets, selectorsets, targets
  4. +
  5. Installation and usage
  6. +
  7. Panels
  8. +
  9. Chapters
  10. +
  11. Modifiers
  12. +
  13. Separators
  14. +
  15. Lists
  16. +
  17. Glossaries
  18. +
  19. Text elements
  20. +
  21. Tables
  22. +
  23. Images
  24. +
  25. Inputs
  26. +
  27. Forms
  28. +
+
+
+

+ Glossary +

+
-
+
+

+ Rulesets, selectorsets, targets +

+
+

+ Targets +

+

+ A Bluelib target is a CSS document where CSS rulesets of a certain type are grouped together. +

+

+ It is composed by two parts: the ruleset, determining the CSS rules to use, and the selectorset, determining the elements to apply the CSS rules on. +

+
+

+ Targets always have a predictable name, which is: +

+
+

+ dist/RULESET.SELECTORSET.css +

+
+

+ Be sure to choose the ones matching your needs! +

+
+

+ By running dist/_build.sh, new targets are generated and compiled from Less to CSS. +

+

+ The cartesian product is applied between all rulesets in src/rulesets and all selectorsets in src/selectorsets, compiling a new target for each pair. +

+
+
+

+ Available rulesets +

+
+
+
+ The base ruleset, providing the layout and basic high contrast theming. +
+
+
+ Inspired by the older Bluelib versions, with semi-transparent panels and rounded borders. +
+
+
+ Made to celebrate the addition of backdrop-filter to Firefox, makes panels have a stained glass background. +
+
+
+ Experimental ruleset with bizzare or buggy but fun rules. Unsupported, do not use in production! +
+
Colors
+
+
+
+
+ Steffo's signature color theme, based upon RYG⁵'s logo colors. +
+
+
+ Nemesis' own color theme, with a "coffee-like" look. +
+
+
+
Fonts
+
+
+
+
+ Font theme based upon Mozilla's Fira font. +
+
+
+
+
+
+

+ Available selectorsets +

+
+
+
+ Simple selectors for usage in plain HTML pages, with short and human-friendly class names. +
+
+
+ All selectors use class names, allowing the usage of the target with CSS Modules. Useful for React or similar web app projects. +
+
+
+
+
+

+ Installation and usage +

+
+

+ Via UNPKG +

+

+ The easiest way to use Bluelib on your website is by using UNPKG. +

+

+ Simply link the stylesheets in the header of your project like this: +

+
+ <link rel="stylesheet" href="https://unpkg.com/@steffo/bluelib@VERSION/dist/RULESET.SELECTORSET.css" type="text/css"/> +
+
+
+

+ Coming soon +

+

+ More installation methods coming soon! +

+
+
+

Panels

@@ -302,7 +459,7 @@ To have a constant height, one has to be set manually.

-
+

Auto-sizing

@@ -346,7 +503,7 @@

-
+

Modifiers

@@ -373,7 +530,7 @@
-
+

Mark

@@ -617,9 +774,9 @@

- Text + Text elements

-
+

Anchors

@@ -640,7 +797,7 @@
-
+

Idiomatic expressions

@@ -653,7 +810,7 @@

-
+

Emphasis

@@ -666,7 +823,7 @@

-
+

Bring attention

@@ -679,7 +836,7 @@

-
+

Strong importance

@@ -692,7 +849,7 @@

-
+

Unarticulated annotations

@@ -705,7 +862,7 @@

-
+

Strike

@@ -718,12 +875,12 @@

-
+

Inserted and deleted text

- When comparing changes to a text, parts of it can be marked as inserted or removed. + When comparing changes to a text, parts of it can be marked as inserted or deleted.

@@ -735,7 +892,7 @@

-
+

Small comment

@@ -751,9 +908,9 @@

-
+

- Preformatted text + Preformatted text

A preformatted text element denotes text where lines and positioning are significant; this prevents them from being rearranged by the browser. @@ -769,9 +926,9 @@ # # "mmm#" "mmm" mm#mm mm#mm

-
+

- Code snippets + Code

A code element denotes that its contents are some kind of code (probably belonging to a programming language). @@ -790,7 +947,7 @@ </div>

-
+

Sample input and output

@@ -809,7 +966,7 @@

-
+

Variables

@@ -822,7 +979,7 @@

-
+

Quotes and citations

@@ -836,7 +993,7 @@

-
+

Definitions

@@ -849,7 +1006,7 @@

-
+

Abbreviations

@@ -865,12 +1022,12 @@

-
+

Ruby

- A ruby text element is text with small annotations above, commonly used in East Asian texts. + A ruby text element is text with small annotations above, commonly used in East Asian texts.

@@ -1133,7 +1290,7 @@ Neon ice cream

-
+

Inputs

@@ -1147,7 +1304,7 @@
-
+

Field

@@ -1232,7 +1389,7 @@

-
+

Area

@@ -1248,7 +1405,7 @@

-
+

Select

@@ -1275,7 +1432,7 @@

-
+

Multiselect

@@ -1315,7 +1472,7 @@

-
+

Radio

@@ -1355,7 +1512,7 @@

-
+

Checkbox

@@ -1407,12 +1564,12 @@

-
+

Color

- A Color (Input) is an Input which allows the user to select a RGB color. + A color input is an Input which allows the user to select a RGB color.

Since browsers usually delegate the rendering of this element to the operating system, it cannot be styled. @@ -1426,12 +1583,12 @@

-
+

File

- A File is an Input which allows the user to upload a file from their computer. + A file input is an Input which allows the user to upload a file from their computer.

Since browsers usually delegate the rendering of this element to the operating system, it cannot be styled. @@ -1445,7 +1602,7 @@

-
+

Range

@@ -1462,7 +1619,7 @@

-
+

Button

@@ -1485,7 +1642,7 @@
-
+

Forms

@@ -1497,12 +1654,12 @@ An form is a non-interactive element which positions Inputs in commonly used ways.

-
+

Flex form

- A flex form is a block form aligning labels and inputs to a pseudo-grid. + A flex form is a block form aligning labels and inputs to a pseudo-grid.

diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index b0bcac5..0000000 --- a/examples/index.js +++ /dev/null @@ -1,69 +0,0 @@ -let retrievedElements = false - -let pageHead = null -let styleBase = null -let styleClassic = null -let styleGlass = null -let styleColors = null -let styleFonts = null - -let checkboxBase = null -let checkboxClassic = null -let checkboxGlass = null -let selectColors = null -let selectFonts = null - -function retrieveElements() { - if(retrievedElements) return - - console.debug("Finding elements in the DOM...") - - pageHead = document.querySelector("head") - styleBase = document.querySelector("#less\\:dist-base\\:root") - styleClassic = document.querySelector("#less\\:dist-classic\\:root") - styleGlass = document.querySelector("#less\\:dist-glass\\:root") - styleColors = document.querySelector("#less\\:dist-colors\\:root") - styleFonts = document.querySelector("#less\\:dist-fonts\\:root") - - checkboxBase = document.querySelector("input[name='bluelib-base']") - checkboxClassic = document.querySelector("input[name='bluelib-classic']") - checkboxGlass = document.querySelector("input[name='bluelib-glass']") - selectColors = document.querySelector("select[name='bluelib-colors']") - selectFonts = document.querySelector("select[name='bluelib-fonts']") - - retrievedElements = true - - console.debug("Found all elements!") -} - - -function onRulesetChange(target) { - retrieveElements() - - if(target === checkboxGlass) { - if(target.checked) { - pageHead.appendChild(styleGlass) - } - else { - styleGlass.remove() - } - } - - if(target === checkboxClassic) { - if(target.checked) { - pageHead.appendChild(styleClassic) - } - else { - styleClassic.remove() - } - } - - if(target === checkboxBase) { - if(target.checked) { - pageHead.appendChild(styleBase) - } - else { - styleBase.remove() - } - } -} diff --git a/src/rules/base.less b/src/rulesets/base.less similarity index 99% rename from src/rules/base.less rename to src/rulesets/base.less index 5e9b88a..754dd0f 100644 --- a/src/rules/base.less +++ b/src/rulesets/base.less @@ -6,7 +6,7 @@ @{bluelib} { /// ===== Body ===== - /// The body element has some rules. + /// The body element has some rulesets. // @@ -31,7 +31,7 @@ // /// ===== All ===== - /// By default, browsers style elements with some weird rules. + /// By default, browsers style elements with some weird rulesets. /// This is an attempt to correct them, and to implement some Bluelib magic. // @@ -70,7 +70,7 @@ // /// ===== Page ===== - /// These rules apply to the four page areas: main, aside, header and footer + /// These rulesets apply to the four page areas: main, aside, header and footer // diff --git a/src/rules/classic.less b/src/rulesets/classic.less similarity index 100% rename from src/rules/classic.less rename to src/rulesets/classic.less diff --git a/src/rules/colors/colors-amber.less b/src/rulesets/colors/colors-amber.less similarity index 100% rename from src/rules/colors/colors-amber.less rename to src/rulesets/colors/colors-amber.less diff --git a/src/rules/colors/colors-royalblue.less b/src/rulesets/colors/colors-royalblue.less similarity index 100% rename from src/rules/colors/colors-royalblue.less rename to src/rulesets/colors/colors-royalblue.less diff --git a/src/rules/fonts/fonts-fira-ghpages.less b/src/rulesets/fonts/fonts-fira-ghpages.less similarity index 100% rename from src/rules/fonts/fonts-fira-ghpages.less rename to src/rulesets/fonts/fonts-fira-ghpages.less diff --git a/src/rules/fun.less b/src/rulesets/fun.less similarity index 100% rename from src/rules/fun.less rename to src/rulesets/fun.less diff --git a/src/rules/glass.less b/src/rulesets/glass.less similarity index 100% rename from src/rules/glass.less rename to src/rulesets/glass.less diff --git a/src/selectors/module.less b/src/selectorsets/module.less similarity index 100% rename from src/selectors/module.less rename to src/selectorsets/module.less diff --git a/src/selectors/root.less b/src/selectorsets/root.less similarity index 100% rename from src/selectors/root.less rename to src/selectorsets/root.less