Skip to content

Conversation

jdegand
Copy link
Contributor

@jdegand jdegand commented Jul 18, 2025

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[ ] Feature
[X] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

Header margin issue.

Closes #4876

What is the new behavior?

I think it looks better without any margin between the code example and header. Header already has enough padding.

Does this PR introduce a breaking change?

[ ] Yes
[X] No

Other information

Copy link

netlify bot commented Jul 18, 2025

Deploy Preview for ngrx-site-v19 ready!

Name Link
🔨 Latest commit 57ea926
🔍 Latest deploy log https://app.netlify.com/projects/ngrx-site-v19/deploys/687ad7cdcb02650008c277e3
😎 Deploy Preview https://deploy-preview-4889--ngrx-site-v19.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link

netlify bot commented Jul 18, 2025

Deploy Preview for ngrx-io canceled.

Built without sensitive environment variables

Name Link
🔨 Latest commit 57ea926
🔍 Latest deploy log https://app.netlify.com/projects/ngrx-io/deploys/687ad7cdbb605a0008e1b666

@jdegand
Copy link
Contributor Author

jdegand commented Jul 18, 2025

On line 30

      .body {
        padding: 0 0px;
      }

There is a missing px in the padding rule. I've noticed a lot of 0px declarations in the styling. This serves no purpose outside of --var and calc and I'd suggest a find and replace to just use 0. Or you can keep it.

@jdegand
Copy link
Contributor Author

jdegand commented Jul 18, 2025

Also, standalone:true is in this component as well. There are likely quite a few of these that can be removed.

@@ -15,7 +15,6 @@ import { Component, Input } from '@angular/core';
display: flex;
flex-direction: column;
border: 1px solid rgba(255, 255, 255, 0.12);
margin: 14px 0 24px;
Copy link
Member

Choose a reason for hiding this comment

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

We have to keep the margin in some cases, otherwise the code is "too attached" to the text above it.

Image

Previously:

Image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hard-coding margin makes the component inflexible. Maybe, it is better to add an input for margin styling. If you add just margin-top: 8px to the component, you'll likely have a situation where a double margin is created somewhere. You could place a class on the app-code-example component and use that to handle margins.

Copy link
Member

@timdeschryver timdeschryver left a comment

Choose a reason for hiding this comment

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

I noticed that this isn't related to the css.
Some code blocks are fine, while other are not.
The reason is the formatting in the docs.

If the code example component goes over multiple lines, the content is not added as the body, but as a separate tag under the component.

<ngrx-code-example header="src/app/app.module.ts">

not fine:

<ngrx-code-example 
   header="src/app/app.module.ts">

Closing this PR and issue, I will go over the examples to fix it.

Thanks for looking into this @jdegand

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.

[New Docs]: code-example styling
2 participants