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

[1.0.0] Padding #215

Closed
JEuler opened this issue Jan 15, 2020 · 9 comments
Closed

[1.0.0] Padding #215

JEuler opened this issue Jan 15, 2020 · 9 comments

Comments

@JEuler
Copy link
Contributor

JEuler commented Jan 15, 2020

Sorry, maybe this is a dumb question, but why the 1.0.0 version is adding somekind of padding to the Html Widget? And how I can remove it?
2020-01-15_15-10-03
Those widgets are aligned on left, but extra padding is adding. Previously I have succesfully avoided it by using blockSpacing

@JEuler
Copy link
Contributor Author

JEuler commented Jan 15, 2020

This is just p tag.

@JEuler JEuler changed the title [1.0.0] [1.0.0] Padding Jan 15, 2020
@JEuler
Copy link
Contributor Author

JEuler commented Jan 15, 2020

I've tried
'p': Style( margin: EdgeInsets.all(0.0), padding: EdgeInsets.all(0.0), )

It removed the vertical padding, but horizontal still with me. I've tried to add it to the html tag - nothing.

@Sub6Resources
Copy link
Owner

The margin is automatically added to the body tag (like a web browser would), so you need to remove it there.

@thukuwanjiku
Copy link

thukuwanjiku commented Feb 14, 2020

I've tried
'p': Style( margin: EdgeInsets.all(0.0), padding: EdgeInsets.all(0.0), )

It removed the vertical padding, but horizontal still with me. I've tried to add it to the html tag - nothing.

@JEuler @Sub6Resources Please help here, where did you use this snippet? I need to remove the vertical padding in my p tags. Which class is this Style(), and in which Html() parameter have you used it in?

@Sub6Resources
Copy link
Owner

Use 'body': Style(margin: EdgeInsets.zero),

I'll add better documentation for this.

@thukuwanjiku
Copy link

Use 'body': Style(margin: EdgeInsets.zero),

I'll add better documentation for this.

@Sub6Resources Where do I place this code?

I have the following code, I don't know where the put your snippet, to remove margins between p tags

Container(
              padding: EdgeInsets.only(left: 20.0),
              child: Html(
                data: item['description'],
                customTextStyle: ( node, TextStyle baseStyle) {
                  if (node is dom.Element) {
                    switch (node.localName) {
                      case "p":
                        return baseStyle.merge(TextStyle(height: 1.0));
                    }
                  }
                  return baseStyle;
                },
              ),
            )

@Sub6Resources
Copy link
Owner

It looks like you aren't using version 1.0.0-pre.1, my code would go in a map in the style attribute in version 1.0.0-pre.1.

@codemewell
Copy link

@Sub6Resources It'd be better to have no margins by default.

@ariona
Copy link

ariona commented Aug 5, 2020

Facing the same problem, but i don't have the body tag inside my content.

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

No branches or pull requests

5 participants