Fix body layout (#1784)

## Description

closes #1781
Also makes body/html layout more modern fixing additional bugs
More details
https://twitter.com/ChallengesCss/status/1471128244720181258

## Steps for reproduction

1. click button
2. expect xyz

## Code Review

- [ ] hi @kof, I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)
  - test it on preview

## Before requesting a review

- [ ] made a self-review
- [ ] added inline comments where things may be not obvious (the "why",
not "what")

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
5de6)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio-builder/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env.example`
and the `builder/env-check.js` if mandatory
This commit is contained in:
Ivan Starkov authored and GitHub committed 2023-06-14 18:32:49 +04:00
1 parent fa8dc705ba
commit 0750cd03f5
2 files changed
+2 -6

No files matched your search

+2 -1
View File
@@ -9,7 +9,8 @@ export const addGlobalRules = (
// @todo we need to figure out all global resets while keeping
// the engine aware of all of them.
// Ideally, the user is somehow aware and in control of the reset
engine.addPlaintextRule("html {margin: 0; height: 100%}");
// Layout source https://twitter.com/ChallengesCss/status/1471128244720181258
engine.addPlaintextRule("html {margin: 0; display: grid; min-height: 100%}");
const fontAssets: FontAsset[] = [];
for (const asset of assets.values()) {
@@ -12,11 +12,6 @@ import type { defaultTag } from "./body";
const presetStyle = {
body: [
...body,
{
property: "minHeight",
value: { type: "unit", unit: "%", value: 100 },
},
{
property: "fontFamily",
value: { type: "keyword", value: "Arial" },