Fix header image size and red line alignment #16256
Conversation
|
github, generate site |
| #bannerRight img { | ||
| transform: translateY(-12px); | ||
| } | ||
|
|
||
| #banner { | ||
| border-bottom: 1px solid #fff; | ||
| background: url("../images/header-background.png") repeat-x scroll 0 0 transparent; | ||
| transform: translateY(-6px); |
There was a problem hiding this comment.
you're transforming the banner to upwards, it is causing banner to have more empty space below it.
We want the red line to stick to the top, the problem is that it is wrapped inside H1 tag which have margin-top & bottom.
Removing margin-top will fix the problem
|
@romani why do we have this red line? and why it is a link? If the red line is only for aesthetics then it doesn't have to be a link |
This is us how kids use to study to write.
I surprised, it supposed to be fancy decor. Link can be removed. |
|
@Zopsss Thank you very much for the feedback. |
@SheikhZaeem it would be very helpful if you can remove the |
|
@Zopsss Yes I want to do it. Thank you |
@Zopsss just to confirm, when removing the <a, should I make sure it s never added in the first place (by changing the js to prevent it), or should I remove it if it already exists in the DOM? |
|
@Zopsss Hello again. I am facing some problem. I removed "var a = document.createElement("a"), a.setAttribute("href", link) andvanchor.appendChild(a)" from anchors.js folder as I believe the are responsible for generating for the red line image section. However, no changes are seen when I inspect the updated html file in the target folder. Could it be that other js file is adding tag around the image or am I missing something? Thank you in advance. |
make sure it is never added in first place |
are you referring to these 2 lines? checkstyle/src/site/resources/js/anchors.js Lines 22 to 23 in 977c425 you don't need to remove In the How to check if the current H1 tag is of Red Line? It is under |
|
@Zopsss Since is already present in target/site/anttask.html, which i am assuming means Maven itself is inserting inside #bannerRight before JavaScript runs. So is coming from |
|
@Zopsss Also now when red line is pressed, it doesn't do anything. I think makes more sense. |
|
Github, generate site |
|
Hmm now the line isnt a link anymore but when hovered over, the anchor image appears next to it I think you can fix this by adding some JS here: checkstyle/src/site/resources/js/anchors.js Lines 17 to 20 in 977c425 Add some logic like if the h1 tag is child of |
Zopsss
left a comment
There was a problem hiding this comment.
fixing extra margins and paddings
| h1 { | ||
| text-transform: capitalize; | ||
| font-size: x-large; | ||
| margin: 0px; |
There was a problem hiding this comment.
revert this, we want margin-top: 0 only for Red Line's H1 tag. Following CSS should remove margin-top and extra padding-top
#bannerRight h1 {
margin: 0;
}
.container-fluid-top {
padding-top: 0 !important;
}There was a problem hiding this comment.
add this code before following line:
to keep same section's CSS together
| #bannerRight img { | ||
| transform: translateY(-12px); | ||
| } | ||
|
|
||
| #banner { | ||
| border-bottom: 1px solid #fff; | ||
| background: url("../images/header-background.png") repeat-x scroll 0 0 transparent; | ||
| transform: translateY(-6px); |
There was a problem hiding this comment.
revert this, use above mentioned code.
|
Fix failing CI it is asking you to follow our commit message rules. |
|
@Zopsss Fixed and reverted the code as you said. But I don't know why I get these errors regarding commit messages. |
|
Github, generate site |
Read the commit message carefully, it has mentioned some rules regarding commit message. You seem to have break 1st rule. The commit message should contain this prefix: Normally you should run |
|
Please squash all commits. Always keep 1 commit per PR. |
Can you explain in more detail. Do you mean if i keep changing the code of my pull request again and again, I don't need to write new commit messages? |
|
Yes, you can amend your changes in your previous commit. No need to create different commit each time. You currently have more than one commit so squash them into one commit, you can google how to do it. |
1858a32 to
9b2e89c
Compare
|
github, generate site |
…updated anchor links
9b2e89c to
5d4d484
Compare
|
github, generate site |
|
@Zopsss I squashed and then I lost some of the changes i did due to my mistake. But I think now it is fine. |
|
Github, generate site |
|
Hey @Zopsss. Thanks for so much help. Is there anything else left for this PR? If not, then I will move to other issues? |
Zopsss
left a comment
There was a problem hiding this comment.
Red line isn't a link anymore and it is sticked to the top now. Thanks a lot for all the hard work!
|
@romani the Checkstyle logo in banner is a link. But I guess it is fine, or do you want to change it? |
romani
left a comment
There was a problem hiding this comment.
@SheikhZaeem , @Zopsss , thanks a lot for collaboration to make a fix !!!
great job !!






This pull request solves the issue #16243, where the header image was larger than intended and also the red line was not touching the top of the page. The changes include:
Fixing the size of header image.
Adjusting the CSS to ensure the red line aligns properly with the top of the page.
Thank you.
Issue Link:
Fixes: #16243