CSS 3.25

CSS 3.25 looks similar to regular CSS 3, but with some differences. Note that B9 is a new engine, not all classic CSS 3 features are supported.

Basic structure

This is an example of a CSS 3.25 file.

styles.css
div {
    border-color: #616161;
    border-width: 1px;
    border-style: solid;
    border-radius: 12px;
    padding: 10px;
    direction: row;
    align-items: center;
    gap: 10;
}

h1 {
    padding: 20px;
    color: #444;
}

p {
    font-size: 16px;
    line-height: 1.5;
    font-family: Iosevka;
    font-weight: bold;

    border-style: solid;
    border-width: 5px;
    border-color: red;

    border-radius: 12px;
}

h4 {
    font-size: 30px;
}

a {
    color: #007bff;
    font-size: 16px;
    text-decoration: none;
    font-weight: ultralight;
    underline: double;
    underline-color: #ff0000;
    overline: single;
    overline-color: #ff0000;
    strikethrough: true;
    strikethrough-color: #ff0000;
    margin-right: 50px;
}

ul, ol {
    margin-left: 20px;
}

ok {
    color: #FF3232;
}

select {
    padding: 5px;
    border-width: 1px;
    border-style: solid;
    border-color: #ccc;
    border-radius: 3px;
    margin-left: 40px;
}

hr {
    border-color: #ccc;
    border-width: 1px;
    border-style: solid;
}

Looks like a lot? It's not that complicated. It's just about taking a few things into account and then just checking a list of properties.

Take into account

  1. No selectors are required: You don't need to use a dot to select a class (e.g. .myClass {}). Since there's no ID's to differentiate with, just put the class name without anything (e.g. myClass{}).

  2. Use specific units: Only px (which is translated to pt) for measures and HEX (#123456) for colors are supported. No RGBa, no HSL, no em, no viewport units...

  3. Remember how the CSS box model works: We use CSS 3's standard box model, where a box has a SIZE, then a PADDING, then a BORDER and a MARGIN.

  4. Events are not supported: As of B9 v1.2.2, events (like :focused, :hover, and so on) are not supported.

Noted that? Now let's get to the styling features.

Styling

Global

Global styles that can be applied to anything

About margin

margin by itself is not supported by B9 as of 1.2.2. You need to give a direction. If you want to set the padding of the top of the box, use margin-top, for example.

border-style values visualised.

Layout

Use these in combination with <div>s to organise your layout.

Text

Use these to style your texts

On runtime, px values get translated to pt values by B9.

Text underline / overline / strikethrough

Non-standard, this feature doesn't exist on CSS 3.

Input and textarea

Width and height are considered "Layout" directives, but since they are only supported by <input> and <textarea> (as of B9 1.2.2), they have their own category for now.

All CSS 3.25 properties

That would be it for styling! Now it's time for the fun part: scripting!

Last updated