Skip to content

fix(docs-infra): fix alert child margin issue#45761

Closed
dario-piotrowicz wants to merge 1 commit intoangular:masterfrom
dario-piotrowicz:aio-fix-margin-in-alerts
Closed

fix(docs-infra): fix alert child margin issue#45761
dario-piotrowicz wants to merge 1 commit intoangular:masterfrom
dario-piotrowicz:aio-fix-margin-in-alerts

Conversation

@dario-piotrowicz
Copy link
Contributor

@dario-piotrowicz dario-piotrowicz commented Apr 25, 2022

replace the generic * selector used in the alert styling with
p (which is what gets generated from the markdown) as the styling adds
margins which are not always wanted

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

Extra margins are added to direct children of .alerts this is ok for auto generated alerts which have a p as their only child, but not in other cases:

(see the alter here: https://angular.io/guide/view-encapsulation)
Screenshot at 2022-04-25 21-22-42



(https://angular.io/guide/lifecycle-hooks)
Screenshot at 2022-04-25 22-37-42

What is the new behavior?

Make the selector more specific so that it targets only direct child p elements (which I would imagine are generally the only ones which should actually get that margin)

Screenshot at 2022-04-25 22-11-31
(PS: the alter still looks a bit off with the link wrapping onto a second line, but I it does look better 😅)



Screenshot at 2022-04-25 22-43-39

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

replace the generic `*` selector used in the alert styling with
`p` (which is what gets generated from the markdown) as the styling adds
margins which are not always wanted
@pullapprove pullapprove bot requested a review from josephperrott April 25, 2022 21:18
@dario-piotrowicz
Copy link
Contributor Author

@gkalpak if you could have a look it would be awesome, I think the change is correct, but it can effect a bunch of places obviously, so yeah I would love to know what you think 🙂

Copy link
Member

@gkalpak gkalpak left a comment

Choose a reason for hiding this comment

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

Good catch!

Theoretically, there shouldn't be alerts without a <p> child. (I see that some of them were accidentally introduced in 42289f2 🤷‍♂️)

I think this is a good solution/work-around 👍

@gkalpak gkalpak added type: bug/fix comp: docs-infra target: patch This PR is targeted for the next patch release labels Apr 27, 2022
@ngbot ngbot bot modified the milestone: Backlog Apr 27, 2022
@gkalpak gkalpak removed the request for review from josephperrott April 27, 2022 11:28
@mary-poppins
Copy link

You can preview 2463bd2 at https://pr45761-2463bd2.ngbuilds.io/.

@dario-piotrowicz
Copy link
Contributor Author

Good catch!

Theoretically, there shouldn't be alerts without a <p> child. (I see that some of them were accidentally introduced in 42289f2 man_shrugging)

I think this is a good solution/work-around +1

Thanks 😄

Yes, I did check with @josmar-crwdstffng before opening the PR, not messing with the md but trying to fix the thing via css seemed the cleanest option 🙂

Alternatively I guess we could update the template generation logic so that alerts inside tables do get the child p 🤔 (but that sounds riskier/more complex than tweaking the css)

@gkalpak
Copy link
Member

gkalpak commented Apr 27, 2022

I doesn't have to do with tables specifically. It's more that our tooling requires (but has no way to enforce) that there is always an empty line when switching from HTML to Markdown in the templates.

Anyway, this is a good enough solution for now, so let's roll with it 👍

@gkalpak gkalpak added the action: merge The PR is ready for merge by the caretaker label Apr 27, 2022
@gkalpak gkalpak modified the milestones: Backlog, docs-infra-aio-app Apr 27, 2022
@atscott
Copy link
Contributor

atscott commented Apr 27, 2022

This PR was merged into the repository by commit f282ca4.

@atscott atscott closed this in f282ca4 Apr 27, 2022
atscott pushed a commit that referenced this pull request Apr 27, 2022
replace the generic `*` selector used in the alert styling with
`p` (which is what gets generated from the markdown) as the styling adds
margins which are not always wanted

PR Close #45761
@dario-piotrowicz dario-piotrowicz deleted the aio-fix-margin-in-alerts branch April 27, 2022 16:56
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators May 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release type: bug/fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants