Skip to content

Commit

Permalink
docs: update mirgration for yoga3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bbohlender committed Mar 26, 2024
1 parent c21511d commit 52487c3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 20 deletions.
10 changes: 0 additions & 10 deletions docs/migration/from-html-css.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,3 @@ uikit is inspired by HTML/CSS. Therefore, many properties are similar with minor

In uikit classes can be defined directly in the file. Styles should not be seperated from their usage.
The use of inline styles is recommended and supported through the typescript type system.

## Defaults

The defaults of the yoga layout engine differs from the defaults on the web. Therefore, some properties turn unnecassary while others need to be added.

- **flexDirection** defaults to `column` instead of `row`
- **alignContent** defaults to `flex-start` instead of `stretch`
- **flexShrink** defaults to `0` instead of `1`

In most cases explicitly specifying the flexDirection is enough.
12 changes: 12 additions & 0 deletions docs/migration/from-koestlich.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,17 @@ This guide is intended for developers migrating their user interface from Koestl
<Text fontFamily="robotoBold">
```


## Defaults

The defaults of the yoga layout engine have changed to match the web defaults. Therefore, some properties turn unnecassary while others need to be added.

- **flexDirection** defaults to `row` instead of `column`
- **alignContent** defaults to `stretch` instead of `flex-start`
- **flexShrink** defaults to `1` instead of `0`

In most cases explicitly specifying the flexDirection is enough.

## Migration Steps

- Remove the index property from your UI elements. The order will be automatically managed.
Expand All @@ -72,5 +83,6 @@ This guide is intended for developers migrating their user interface from Koestl
- Rname DefaultStyleProvider to DefaultProperties
- Remove the depth property from all SVG components
- Replace usages of the Box component with a Content component containing an Object3D with a BoxGeomtry.
- Adapt the components to use to the new defaults, which most likely means explicitly setting `flexDirection` to `row` and `flexShrink` to `0`.
By following these steps, you should be able to smoothly transition your user interface from Koestlich to uikit, taking advantage of the latter's streamlined properties and components.
10 changes: 0 additions & 10 deletions docs/migration/from-tailwind.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,3 @@ uikit is inspired by tailwind. Therefore, many properties are similar with minor
In contrast to tailwind, uikit's core units are pixels. Therefore, sizes such as `p-3`, which translates to `padding: 0.75rem` or `padding: 16px` would be expressed as `padding={16}` in uikit. The rule for sizes is to multiply the tailwind value times 4.

Other sizes such as border radii (e.g. `rounded-md`) must be converted by looking into the [Tailwind Documentation](https://tailwindcss.com/docs). In this case `rounded-md` translates to `borderRadius={6}`.

## Defaults

The defaults of the yoga layout engine differs from the defaults on the web. Therefore, some properties turn unnecassary while others need to be added.

- **flexDirection** defaults to `column` instead of `row`
- **alignContent** defaults to `flex-start` instead of `stretch`
- **flexShrink** defaults to `0` instead of `1`

In most cases explicitly specifying the flexDirection is enough.

0 comments on commit 52487c3

Please sign in to comment.