Skip to content

Commit e859095

Browse files
committed
Minor doc improvements and fixes for latest alpha
1 parent d534f8d commit e859095

File tree

12 files changed

+144
-184
lines changed

12 files changed

+144
-184
lines changed

content/docs/colors.md

Lines changed: 1 addition & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -6,102 +6,4 @@ The color CSS data-type represents a color in the sRGB color space. Colors can b
66

77
<doc-colors></doc-colors>
88

9-
Just like other colors like `#7A4ACF`, `hsl(120,90%,45%)`, `rgba(120,255,176)`, these named colors can be used anywhere in your styles where a color value is expected.
10-
11-
## Color Theming
12-
13-
Imba already contains color keywords, but you may also create aliases for color keywords, make your own keywords, or redefine the default keywords to new color values.
14-
15-
### Create config file
16-
17-
Create an `imbaconfig.json` at the root of your imba project. Right next to your package.json and readme.md files.
18-
19-
```json
20-
{
21-
"theme": {
22-
"colors": {
23-
}
24-
}
25-
}
26-
```
27-
28-
> Any changes made to the imbaconfig.json file will require you to restart your localhost server to take effect.
29-
30-
### Aliasing colors
31-
32-
We can create an alias for the `indigo` color called `primary` in this way.
33-
34-
```json
35-
{
36-
"theme": {
37-
"colors": {
38-
"primary": "indigo"
39-
}
40-
}
41-
}
42-
```
43-
44-
Now we can use `primary` instead of `indigo` to set the indigo color.
45-
46-
```imba
47-
<h1[c:primary4]> "hello world!"
48-
```
49-
50-
We can also override default color keywords. We can make `gray` an alias for `warmer` instead of the default gray colors.
51-
52-
```json
53-
{
54-
"theme": {
55-
"colors": {
56-
"gray": "warmer"
57-
}
58-
}
59-
}
60-
```
61-
62-
### Defining custom colors
63-
64-
We can create our own color keywords with specified tint values.
65-
66-
```json
67-
{
68-
"theme": {
69-
"colors": {
70-
"coral": {
71-
"0": "hsl(40,33%,98%)",
72-
"1": "hsl(28,61%,94%)",
73-
"2": "hsl(12,62%,88%)",
74-
"3": "hsl(10,54%,76%)",
75-
"4": "hsl(6,56%,65%)",
76-
"5": "hsl(5,49%,54%)",
77-
"6": "hsl(4,49%,44%)",
78-
"7": "hsl(4,50%,34%)",
79-
"8": "hsl(4,50%,24%)",
80-
"9": "hsl(6,52%,15%)"
81-
}
82-
}
83-
}
84-
}
85-
```
86-
87-
We will then be able to use our own color keyword as we would use the default color keywords.
88-
89-
```imba
90-
<h1[c:coral7/70]> "hello world!"
91-
```
92-
93-
Any unspecified tint will be interpolated automatically. So the configuration below will produce a similar result.
94-
95-
```json
96-
{
97-
"theme": {
98-
"colors": {
99-
"coral": {
100-
"0": "hsl(40,33%,98%)",
101-
"4": "hsl(6,56%,65%)",
102-
"9": "hsl(6,52%,15%)"
103-
}
104-
}
105-
}
106-
}
107-
```
9+
Just like other colors like `#7A4ACF`, `hsl(120,90%,45%)`, `rgba(120,255,176)`, these named colors can be used anywhere in your styles where a color value is expected.

content/docs/style-properties.md

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,12 @@
11
# Style Properties
22

3-
Imba supports all regular css properties. For a full reference on all css properties we recommend visiting the MDN docs. There are some custom properties and shorthands added in Imba that are very valuable. There are also a configurable design system (inpsired by Tailwind) built in. Among other things, this features non-standard values for [box-shadow](css), [border-radius](css), [transition-timing-function](css), as well as [color](css) palettes. The custom [hue](css) property is especially useful..
3+
Imba supports all regular css properties. For a full reference on all css properties we recommend visiting the MDN docs. There are some custom properties and shorthands added in Imba that are very valuable. There are also a configurable design system (inpsired by Tailwind) built in. Among other things, this features non-standard values for [display](css), [box-shadow](css), [border-radius](css), [transition-timing-function](css), as well as [color](css) palettes. The custom [hue](css) property is especially useful..
44

5-
## Flex Layout
6-
7-
#### Properties
8-
9-
<api-list>css.own.properties ^(flex)</api-list>
10-
11-
#### Display Values
12-
13-
<api-list>css.display.all ^[hv]?(flex)</api-list>
14-
15-
## Grid Layout
16-
17-
#### Properties
18-
19-
<api-list>css.own.properties ^(grid)</api-list>
20-
21-
#### Display Values
22-
23-
<api-list>css.display.all ^[vhlrtb]?(grid)</api-list>
24-
25-
## Alignment
26-
27-
<api-list>css.own.properties ^(place|align|justify)</api-list>
28-
29-
## Transforms
30-
31-
<api-list>css.own.properties.preferred transform</api-list>
32-
33-
## Easing
34-
35-
### Properties
5+
## Standard CSS Properties
366

37-
<api-list>css.own.properties.preferred (^ease)|(^e[atocb]?[dfw]?$)</api-list>
7+
<api-grid>css.own.properties.native</api-grid>
388

399
## Non-standard Properties
4010

4111
<api-grid>css.own.properties.custom</api-grid>
4212

43-
## Standard CSS Properties
44-
45-
<api-grid>css.own.properties.native</api-grid>
Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,10 @@ import 'util/styles'
33
export const vars = {flag: 'demo-1'}
44

55
# ---
6-
css .demo-1 d:flex
7-
css .demo-2 d:hflex
8-
css .demo-4 d:hflex ja:center
9-
css .demo-6 d:hflex ai:stretch
10-
css .demo-7 d:hflex jc:space-between
11-
css .demo-3 d:vflex
12-
css .demo-5 d:vflex ai:stretch
13-
css .demo-7 d:vflex jc:space-between
6+
css .demo-1 d:block # horizontal top left
7+
css .demo-2 d:inline # horizontal top center
8+
css .demo-3 d:inline-block # horizontal top right
9+
css .demo-4 d:flex # ...
1410
# ---
1511

1612
imba.mount do <.inline-demo>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# [preview=styles]
2+
import 'util/styles'
3+
export const vars = {flag: 'demo-1'}
4+
5+
# ---
6+
css .demo-1 d:htl # horizontal top left
7+
css .demo-2 d:htc # horizontal top center
8+
css .demo-3 d:htr # horizontal top right
9+
css .demo-4 d:hts # horizontal top space-between
10+
11+
css .demo-5 d:hcl # horizontal center left
12+
css .demo-6 d:hcc # horizontal center center
13+
css .demo-7 d:hcr # horizontal center right
14+
css .demo-8 d:hcs # horizontal center space-between
15+
css .demo-9 d:hbl # horizontal bottom left
16+
css .demo-10 d:hbc # horizontal bottom center
17+
css .demo-11 d:hbr # horizontal bottom right
18+
css .demo-12 d:hbs # horizontal bottom space-between
19+
20+
css .demo-13 d:hsl # horizontal stretch left
21+
css .demo-14 d:hsc # horizontal stretch center
22+
css .demo-15 d:hsr # horizontal stretch right
23+
css .demo-16 d:hss # horizontal stretch space-between
24+
# ---
25+
26+
imba.mount do <.inline-demo>
27+
<div[g:2 p:2 rd:6px size:180px bd:1px dashed cooler4/50 bg:cooler7/10].{vars.flag}>
28+
<div.child[rd:3px min-width:40px min-height:40px bg:teal4]>
29+
<div.child[rd:3px min-width:50px min-height:50px bg:indigo4]>
30+
<div.child[rd:3px min-width:30px min-height:30px bg:purple4]>

content/examples/css/display.imba

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# [preview=styles] [example=ImbaTouch.@moved-x]
2+
import 'util/styles'
3+
export const vars = {flag: 'demo-1'}
4+
5+
# ---
6+
css .demo-1 d:vtl # vertical top left
7+
css .demo-2 d:vtc # vertical top center
8+
css .demo-3 d:vtr # vertical top right
9+
css .demo-4 d:vts # vertical stretch
10+
11+
css .demo-5 d:vcl # vertical center left
12+
css .demo-6 d:vcc # vertical center center
13+
css .demo-7 d:vcr # vertical center right
14+
css .demo-8 d:vcs # vertical center stretch
15+
16+
css .demo-9 d:vbl # vertical bottom left
17+
css .demo-10 d:vbc # vertical bottom center
18+
css .demo-11 d:vbr # vertical bottom right
19+
css .demo-12 d:vbs # vertical bottom stretch
20+
21+
css .demo-13 d:vsl # vertical space-between left
22+
css .demo-14 d:vsc # vertical space-between center
23+
css .demo-15 d:vsr # vertical space-between right
24+
css .demo-16 d:vss # vertical space-between stretch
25+
# ---
26+
27+
imba.mount do <.inline-demo>
28+
<div[g:2 p:2 rd:6px size:180px bd:1px dashed cooler4/50 bg:cooler7/10].{vars.flag}>
29+
<div.child[rd:3px min-width:40px min-height:40px bg:teal4]>
30+
<div.child[rd:3px min-width:50px min-height:50px bg:indigo4]>
31+
<div.child[rd:3px min-width:30px min-height:30px bg:purple4]>

content/examples/util/styles.imba

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ global css .striped
222222

223223
global css .inline-demo
224224
d:hflex pos:absolute inset:0 ja:center
225-
div d:flex ja:center
225+
div d:flex # ja:center
226226

227227
.filled
228228
pos:absolute inset:0 d:flex ja:center rd:sm

content/nav.md

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -56,33 +56,25 @@ Reference for all event modifiers.
5656

5757
Reference for all events and their interfaces.
5858

59-
## Styles [doc=docs/styles] [href=/docs/css]
59+
# Styling [doc=docs/styles] [href=/docs/css]
6060

61-
### Syntax [doc=docs/style-syntax] [href=/docs/css/syntax]
61+
## Syntax [doc=docs/style-syntax] [href=/docs/css/syntax]
6262

6363
Basic descriptions of how to write styles in imba.
6464

65-
### Properties [doc=docs/style-properties] [href=/docs/css/properties]
65+
## Properties [doc=docs/style-properties] [href=/docs/css/properties]
6666

6767
Reference for all shorthands and regular css properties.
6868

69-
### Modifiers [doc=docs/style-modifiers] [href=/docs/css/modifiers]
69+
## Modifiers [doc=docs/style-modifiers] [href=/docs/css/modifiers]
7070

7171
Reference for all style modifiers.
7272

73-
### Custom Units [doc=docs/style-units] [href=/docs/css/units]
73+
## Custom Units [doc=docs/style-units] [href=/docs/css/units]
7474

7575
Defining and using custom style units.
7676

77-
### Colors [doc=docs/colors] [href=/docs/css/colors]
78-
79-
### Values [doc=docs/style-data-types] [href=/docs/css/values]
80-
81-
Reference for all css data types like `<color>`, `<angle>` and `<length>`
82-
83-
## Assets [doc=docs/assets] [href=/docs/assets]
84-
85-
## Router [doc=docs/router] [href=/docs/router]
77+
## Colors [doc=docs/colors] [href=/docs/css/colors]
8678

8779
# Guides [href=/guides] [doc=guides/index]
8880

@@ -100,6 +92,10 @@ Reference for all css data types like `<color>`, `<angle>` and `<length>`
10092

10193
# Other [href=/other] [doc=docs/other]
10294

95+
## Assets [doc=docs/assets] [href=/docs/assets]
96+
97+
## Router [doc=docs/router] [href=/docs/router]
98+
10399
## API Reference [href=/api]
104100

105101
## Changelog [doc=changelog] [href=/changelog]

content/reference.md

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,19 @@ The global `imba` object contains functions, constants and classes that are incl
3030

3131
The display CSS property sets whether an element is treated as a block or inline element and the layout used for its children, such as flow layout, grid or flex.
3232

33-
Formally, the display property sets an element's inner and outer display types. The outer type sets an element's participation in flow layout; the inner type sets the layout of children. Some values of display are fully defined in their own individual specifications; for example the detail of what happens when display: flex is declared is defined in the CSS Flexible Box Model specification.
33+
In addition to the regular display values, Imba defines a bunch of shorthands for common layouts. For flexboxes you
34+
can quickly declare most flex-layouts using a three-letter alias, where the first letter denotes [v]ertical or [h]orizontal. The second character denotes the vertical aligment, and the third character denotes the horizontal alignment.
35+
36+
### Regular display values
37+
[demo](/examples/css/display.basic.imba?preview=styles)
38+
> All regular display properties works just like in css.
39+
40+
### Shorthands for flex-direction:column layouts
41+
[demo](/examples/css/display.imba?preview=styles)
42+
43+
### Shorthands for flex-direction:row layouts
44+
[demo](/examples/css/display.h.imba?preview=styles)
45+
3446

3547
## Values
3648

@@ -44,9 +56,32 @@ Formally, the display property sets an element's inner and outer display types.
4456

4557
<api-list>style.type.timing-function ^[^-]</api-list>
4658

59+
# /docs/css/properties/font-weight
60+
61+
```imba
62+
# [preview=styles]
63+
import 'util/styles'
64+
export const vars = {flag: 'demo-1'}
65+
66+
# ---
67+
css .demo-1 fw:100
68+
css .demo-2 fw:900
69+
css .demo-3 fw:normal
70+
css .demo-4 fw:bold
71+
css .demo-5 fw:lighter
72+
css .demo-6 fw:bolder
73+
# ---
74+
75+
imba.mount do <.inline-demo.typography> <div.{vars.flag}> 'Text'
76+
```
77+
4778
# /docs/css/properties/margin
4879

49-
[demo](/examples/css/colors.imba?preview=styles)
80+
81+
82+
# /docs/css/properties/color
83+
84+
> For the actual list of built-in colors and more, see **[Colors](/docs/css/colors)**
5085
5186
# /api/Element/@touch
5287

src/compiler.imba

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import * as esml from 'es-module-lexer'
22

33
const ResolveMap = {
4-
'imba': 'https://unpkg.com/imba@2.0.0-alpha.223/dist/imba.mjs'
4+
'imba': 'https://unpkg.com/imba@2.0.0-alpha.243/dist/imba.mjs'
5+
'imba/runtime': 'https://unpkg.com/imba@2.0.0-alpha.243/src/imba/runtime.mjs'
56
'imdb': '/imdb.js'
67
}
78

src/components/app-document.imba

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -419,11 +419,6 @@ tag app-document
419419
for item in breadcrumbs
420420
<span> <a href=item.href .self=(item == data)> item.navName or item.name
421421
<app-search-field>
422-
<div[d:hflex ja:center bg:yellow2 p:3 4 rd:lg c:yellow9 mt:2 fs:xs d:none]>
423-
<div[fl:1 d:vflex]>
424-
<span[c:yellow9 fw:600 fs:sm]> "We are overhauling the docs, and we need your help!"
425-
<span[c:yellow8]> "Do you have a few minutes to answer what you think is missing? "
426-
<a[c:blue6 td:underline fs:sm fw:600] href='https://form.typeform.com/to/GdMKZMBh'> 'Take Survey'
427422
<div$content>
428423
if doc.api?
429424
<api-symbol-entry key=doc.href data=doc>
@@ -501,12 +496,6 @@ tag app-document-toc
501496
<div.menu-heading[c:gray5 px:0]> "On this page"
502497
<.children> for item in data.sections
503498
<TocItem data=item level=1>
504-
505-
<.wip>
506-
css w: <200px fs:sm- bg:yellow2/80 px:4 py:3 rd:md bdl:none c:yellow9 mt:4
507-
<div[fw:bold]> "We are overhauling the docs, and we need your help!"
508-
<div[my:4]> "Do you have a few minutes to answer what you think is missing?"
509-
<a[td:underline fs:lg c:blue7] href="https://form.typeform.com/to/GdMKZMBh"> "Take survey"
510499

511500
tag embedded-app-document
512501
def hydrate

0 commit comments

Comments
 (0)