Main Javascript scans for class names inside an element. If a class name matches with a class
list, it will automatically add a specific value or stylesheet for that specific name.
Classes can be implemented by writing a class name (for more context, see class list) and add a value you would like to have for that element.
<h3 class="bg-#ff0000">Hello world</h3>
This means, that the class bg-#ff0000 will have a red background color.
Hello world
You can use this for pretty much every class that is inside of a PixelbiteCSS library (for
more context, see class list).
1.3. Templates
If you are looking for a quick look-up, how PixelbiteCSS works or if you are lazy to program
a functional website. You can look up into our templates. Feel free to copy and use.
PixelbiteCSS use custom elements, which are staple of a first version and was a main
appealing point for creating this framework.
Different elements have different syntax. Most features are still in experimental state, so please
have in mind some minor bugs if not used correctly.
3.1. Onclick href
Onclick href is essentially a function that allows buttons to open pages and scroll to
different articles on page.
Syntax is href('[url_or_pointer]')
<button onclick="href('https://github.com/Pixelbite-CSS')">Open page my favorite page</button>
<button onclick="href('#onclick-href')">Scroll to my favorite article</button>
3.2. Toggle element
Toggle element is a function, that can show and hide multiple elements with same classname.
Syntax is toggleElement([class_name_of_elements_to_hide])
You can put which ever name
you want, but some classnames already used in a file can cause damage to those elements.
Please use
unique class name.
Loaders loads first over everything. They essentially cover whole screen to hide elements
loading in.
It is highly recommended to use. They are only used for loading page in, other instances
can break the whole site. Always put them on the bottom of page.
In PixelbiteCSS there are two main loaders. loader-line and
loader-icon.
PixelbiteCSS has many features that are great and are just a really nice addition for every
web developer and web designer.
4.1. Dark mode
Dark mode is essential for PixelbiteCSS. It is very easy to use with its syntax.
You will also need to call a function
changeThemeMode() to switch themes.
Syntax is dark:[class]-[params]-...
The dark: followed by a class needs to be after normal classes to work.
<div class="bg-#ff0000 dark:bg-#0000ff p-24px">
Hello world
</div>
Hello world
4.2. Foreach
Experimental
Foreach will add specific class to everything inside an element. Syntax is similar to dark mode, which is foreach: followed by class and its
parameters.
Custom variables allows you to change :root variables to your own liking.
It is the first thing that loads with the page. There are these possible variables that can be
changed:
--font-family
--font-mono-family
--primary-color
--secondary-color
--success-color
--danger-color
--warning-color
--info-color
Syntax is changeVariable('[variable_pointer]', '[variable_value]')
Alias classes are here, to chain multiple classes into one singular head class, that can be
referenced anywhere in a file. You can create so-called modules with just one alias.
Syntax is addAliasClass('[alias_name]', '[string_with_classes]')
Update delay is only a performance related function. Because PixelbiteCSS's main loop
is constantly changing, it can develop and hardware slowdown issue. To reduce hardware slowdown,
there is a function that can change delay between each loop.
Don't put very high numbers, the loop contains dark mode related
stuff, but if you are not
using it, there is nothing to worry about.