Skip to content

Components should create a display:block style by default #12244

Closed
@hansl

Description

@hansl

From @SanderElias on September 7, 2018 11:19

I'm submitting a...


[ X ] Feature request
[ X ] Documentation issue or request

Current behaviour

When you create a new component, by default it gets no setting for css display.

Expected behavior

it should have display:block by default.

What is the motivation/use case for changing the behavior?

I know this has been discussed before (#5960), and pops up in (#12340) too.
Still, I'm putitng this back on the roll. For the following reasons:

  1. Current behaviour is confusing for new devs
  2. Devs need display:block most of the time (for me, its 99+%)
  3. The web doesn't break if we put this in place.
  4. The expected impact of this "breaking" change is minimal
  5. Saves a few bits from the app's payload
  6. Less questions. no more, why does my css....
  7. One more thing less to remember when creating a component.

I want to elaborate on point 3 a bit. The same discussion has been held in by standarts committee, If you follow along that discussion you will see that the general consensus is that it is actually a good idea, but it can't be changed because that would break the web. Angular does not have that issue. Angular can change this, and the impact of the change would be minimal. probably something that has less impact as for example rxjs 5 to 6.

Others:
If we don't do this change, at least there should be more emphasis on this in the documentation.

Copied from original issue: angular/angular#25856

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureIssue that requests a new feature

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions