Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override browser default tag based styles that use EM units #1888

Merged
merged 5 commits into from
Jul 3, 2023

Conversation

kof
Copy link
Member

@kof kof commented Jul 2, 2023

Description

EM seems to be challenging to use and people tend to use PX or REM instead ... I changed those values that come with EM by default from browsers to the values Webflow is using.

I am not sure why webflow is doing certain things: e.g. paragraphs have marginTop 0, h1-3 have marginTop 20; marginBottom: 10, h4- have marginTop 10 ; marginBottom 20

These seem to be inconsistent and weird choices.

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 document
  • added tests
  • if any new env variables are added, added them to .env.example and the builder/env-check.js if mandatory

@vercel
Copy link

vercel bot commented Jul 2, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
webstudio-builder ✅ Ready (Inspect) Visit Preview Jul 3, 2023 5:38pm

@kof kof requested review from TrySound, istarkov, taylornowotny and darindimitroff and removed request for TrySound July 2, 2023 15:24
Copy link
Member

@istarkov istarkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't look like normalize now. Its set of opinionated styles has nothing with initial behavior of normalize - makes browsers render all elements more consistently

@istarkov
Copy link
Member

istarkov commented Jul 2, 2023

I think if we do changes which are different from notmalize.css we need to do them in other place

@kof
Copy link
Member Author

kof commented Jul 2, 2023

It doesn't look like normalize now. Its set of opinionated styles has nothing with initial behavior of normalize - makes browsers render all elements more consistently

yes which is why the opinionated styles are in a separate file, but we use them from normalize ... should probably merge them together in a different way instead of using reset directly from normalize, but that's not new here .. this was done before ... may need to change this @TrySound

@taylornowotny
Copy link
Contributor

taylornowotny commented Jul 3, 2023

  • The font and height properties have an orange label with no Value source in the tooltip. Orange labels represent remote user-added values so they should always show the value source in the tooltip. But these orange labels show on a new project with no user styles. These properties should be gray labels (Webstudio default) instead.
Screenshot 2023-07-03 at 9 07 06 AM Screenshot 2023-07-03 at 9 09 44 AM
  • Why do we have a text element nested inside the heading? I would expect that the headings can not be containers.
Screenshot 2023-07-03 at 9 10 34 AM

@kof
Copy link
Member Author

kof commented Jul 3, 2023

@taylornowotny separate problem, unrelated to this PR

@kof
Copy link
Member Author

kof commented Jul 3, 2023

After a discussion we decided to not have margins by default at all

@TrySound
Copy link
Member

TrySound commented Jul 3, 2023

this was done before ... may need to change this @TrySound

let's do it later

@TrySound TrySound merged commit 8f53ead into main Jul 3, 2023
@TrySound TrySound deleted the use-px-units branch July 3, 2023 20:13
...baseStyle,
...presets.blockquote,
] satisfies Styles;
export const figure = [...baseStyle, ...presets.margins] satisfies Styles;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might not need margins, but only vertical margins, need to check browser defaults there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants