# 🖌️ CSS

## Imports

You can set a stylesheet to be used in a canvas by using the `stylesheet` property on the root node. The path is relative to the project’s root directory.

```csharp
<div stylesheet="path_to_stylesheet.css">
  // Rest of layout
</div>
```

  
If you wish to use more than one stylesheet in a canvas, you can use the `@import` in your main CSS file.

```csharp
@import "my_other_css.css";

// rest of CSS
```

## Supported CSS properties

| Property name | Property value |
|---------------|----------------|
| background-color | HEX COLOR      |
| border-width  | float          |
| width, min-width, max-width | %, px or auto  |
| height, min-height, max-height | %, px or auto  |
| padding-left, padding-right, padding-top, padding-bottom | %, px or auto  |
| margin-left, margin-right, margin-top, margin-bottom | %, px or auto  |
| position      | Absolute, relative |
| self-align    | auto, flex-start, flex-end, center |
| justify-content | flex-start, flex-end, center, space-between, space-around, space-evenly |
| align-items   | flex-start, flex-end, center, space-between, space-around, space-evenly |
| flex-wrap     | wrap, no-wrap, wrap-reversed |
| flex-direction | row, column, row-reverse, column-reversed |
| flex-basis    | px, %          |
| flex-grow     | %              |
| flex-shrink   | %              |
| align-content | flex-start, center, flex-end, stretch, space-between, space-around |
| border-size   | float          |
| border-radius | px             |
| border-color  | hex            |
| font-size     | px             |
| font-family   | path to a font file |
| text-align    | left, right, center |
| font-color    | hex            |
| overflow      | show, hidden, scroll |
| visibility    | visible, hidden |
| background-image | path to an image |
| z-index       | int            |
| top, bottom, left, right | px             |


## Supported rules

| Selector | Example | Explanation |
|----------|---------|-------------|
| class    | `.button` | Selects all elements with the specified class |
| id       | `#root` | Selects a unique id |
| \:hover, :active | `.button:hover` | Selects when the class is hovered |
| descendent | `.dropdown .content` | Selects all child of `dropdown` with the class `content` |

---

**Documents**

- [Project Status](https://docs.antopilo.dev/s/2b239c4c-0499-4059-8de9-b240f71887c0/doc/project-status-6fyDviuXlE)
- [Welcome](https://docs.antopilo.dev/s/2b239c4c-0499-4059-8de9-b240f71887c0/doc/welcome-yF3kGz8XH3)
- [Workflow](https://docs.antopilo.dev/s/2b239c4c-0499-4059-8de9-b240f71887c0/doc/workflow-S9ota9vgbD)
- [Scene](https://docs.antopilo.dev/s/2b239c4c-0499-4059-8de9-b240f71887c0/doc/scene-HdnkvdILFd)
- [Scripting](https://docs.antopilo.dev/s/2b239c4c-0499-4059-8de9-b240f71887c0/doc/scripting-LI3IE46tt2)
- [UI](https://docs.antopilo.dev/s/2b239c4c-0499-4059-8de9-b240f71887c0/doc/ui-ZW3OQfS29Z)
- [Debugging](https://docs.antopilo.dev/s/2b239c4c-0499-4059-8de9-b240f71887c0/doc/debugging-UmswlxDLyv)
- [Modules](https://docs.antopilo.dev/s/2b239c4c-0499-4059-8de9-b240f71887c0/doc/modules-h26DveHarI)