Skip to content

Commit 361eaa3

Browse files
authored
feat: update README.md
1 parent fdba1de commit 361eaa3

1 file changed

Lines changed: 149 additions & 1 deletion

File tree

README.md

Lines changed: 149 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,149 @@
1-
# mlut website
1+
# How to Work with the mlut Website
2+
3+
If you like our website and want to contribute — great news! You can submit your own art created with **mlut** and have it featured in our gallery.
4+
5+
---
6+
7+
## Installation
8+
9+
1. Fork our repository from GitHub: [https://github.com/mlutcss/website](https://github.com/mlutcss/website)
10+
2. Clone your fork locally using `git clone` (or add it as a remote).
11+
3. Open a terminal (for example, Git Bash) and install all dependencies:
12+
13+
```bash
14+
npm ci
15+
```
16+
4. You’re all set — feel free to explore and start creating!
17+
18+
---
19+
20+
## Environment Overview
21+
22+
Before making changes, please read through the conventions and tools we use in this project.
23+
24+
### Eleventy (11ty)
25+
26+
Our website is built with **Eleventy (11ty)** — a static site generator. We use **EJS** as our templating language, and we expect contributions to follow the same approach.
27+
28+
Both tools have clear and beginner‑friendly documentation:
29+
30+
* Eleventy: [https://www.11ty.dev/docs/](https://www.11ty.dev/docs/)
31+
* EJS: [https://ejs.co/#docs](https://ejs.co/#docs)
32+
33+
If you’re not familiar with them yet — don’t worry, they’re easy to pick up.
34+
35+
### mlut
36+
37+
We use **mlut** to generate all CSS for the website. Every art piece shown in the gallery **must be styled using mlut utilities**.
38+
39+
mlut allows you to write utilities in several places:
40+
41+
* `class` attributes of HTML elements
42+
* JavaScript strings
43+
* String values of object properties
44+
45+
The mlut configuration is located in `src/assets/style/style.scss`.
46+
47+
48+
Please **do not modify this file** unless absolutely necessary. It contains core variables and rules used across the entire website.
49+
50+
**The only allowed exception** is adding a background color for your art in the gallery — this is explained in the Contribution section below.
51+
52+
### Scripts
53+
54+
The `package.json` file contains several useful scripts for development:
55+
56+
* **`npm run build`** runs `npx @11ty/eleventy` and `npx mlut -i src/assets/style/style.scss`. Builds the `dist` folder and generates all CSS styles using mlut.
57+
58+
* **`npm run mlut`** is equivalent to `npx mlut -i src/assets/style/style.scss -w`. Starts the mlut JIT engine and automatically generates styles based on templates.
59+
60+
* **`npm start`** is alias for `npx @11ty/eleventy --serve`. Launches a local development server.
61+
62+
---
63+
64+
## Contribution Guide
65+
66+
To add your own art made with mlut, follow these steps.
67+
68+
### 1. Create the art layout
69+
70+
Create a new `.ejs` file in the following folder `src/arts/`.
71+
72+
This file should contain the layout of your art. You may use EJS features or plain HTML — both are perfectly fine.
73+
74+
### 2. Name the file correctly
75+
76+
* The filename **must be unique**.
77+
* It must match the art’s identifier.
78+
* Use **kebab-case** only.
79+
80+
Valid examples:
81+
82+
* `ghost`
83+
* `penrose-triangle`
84+
* `pretty-long-art-name`
85+
86+
### 3. Register your art
87+
88+
Open the file `src/_data/arts.json`.
89+
90+
Add a new object describing your art. A typical entry looks like this:
91+
92+
```json
93+
{
94+
"caption": "Penrose triangle",
95+
"artId": "penrose-triangle",
96+
"bgColor": "Bgc-$art850"
97+
}
98+
```
99+
100+
* `artId` — must match the filename of your `.ejs` file.
101+
* `caption` — optional and can be omitted.
102+
103+
### 4. Add a background color
104+
105+
Each art in the gallery has its own background color.
106+
107+
Open the mlut config file `src/assets/style/style.scss`.
108+
109+
Find the color palettes defined for:
110+
111+
* Dark theme: `@media (prefers-color-scheme: dark)`
112+
* Light theme: `@media (prefers-color-scheme: light)`
113+
114+
Inside the appropriate media query, add a custom CSS property following this pattern:
115+
116+
```scss
117+
@media (prefers-color-scheme: dark) {
118+
html {
119+
/* core styles */
120+
--ml-artYourArtName: /* your art background color */
121+
}
122+
}
123+
```
124+
125+
Please follow these rules:
126+
127+
* Use **camelCase** for custom property names.
128+
* Replace `YourArtName` with your actual art name.
129+
130+
### 5. Link the background color
131+
132+
Return to your art object in `src/_data/arts.json` and set the `bgColor` value to:
133+
134+
```
135+
"Bgc-$artYourArtName"
136+
```
137+
138+
### 6. Submit your work
139+
140+
* Double‑check that everything works correctly.
141+
* Commit your changes.
142+
* Push them to your forked repository.
143+
* Open a Pull Request to the original repository.
144+
145+
---
146+
147+
That’s it!
148+
149+
We’re excited to see your creations and hope they’ll become part of our **pure CSS art gallery**

0 commit comments

Comments
 (0)