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

Styling Update for Header and Footer Elements #2502

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification\
/* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification\
for details on configuring this project to bundle and minify static web assets. */

body {
padding-top: 50px;
padding-bottom: 20px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
</head>
<body>
<header>
<nav class="navbar navbar-expand-sm navbar-light navbar-toggleable-sm bg-white border-bottom box-shadow mb-3">
<div class="container">
<nav class="navbar navbar-expand-sm navbar-toggleable-sm border-bottom box-shadow mb-3">
Copy link
Member

Choose a reason for hiding this comment

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

What's wrong with navbar-light and bg-white for the bar?

<div class="container-fluid">
Copy link
Member

Choose a reason for hiding this comment

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

Why use "container-fluid" here but not on line 48? Why use it at all? Is having fixed widths that bad?

<a class="navbar-brand" href="~/">@Model.ApplicationName</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".navbar-collapse" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
/* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification\
for details on configuring this project to bundle and minify static web assets. */

a.navbar-brand {
white-space: normal;
text-align: center;
word-break: break-all;
}

/* Sticky footer styles
-------------------------------------------------- */
html {
font-size: 14px;
}
@media (min-width: 768px) {

@media (min-width: 576px) {
Copy link
Member

Choose a reason for hiding this comment

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

Why did you reduce the min width?

Copy link
Author

@sultan sultan Aug 25, 2023

Choose a reason for hiding this comment

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

because the layout uses bootstrap small size which is 576
if you want to use 768 here, the layout has to be changed to use large bootstrap breakpoints instead

html {
font-size: 16px;
}
}

a.navbar-brand {
white-space: normal;
text-align: center;
word-break: break-all;
}
Copy link
Member

Choose a reason for hiding this comment

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

Why did this move?


.container {
max-width: 960px;
}
Expand All @@ -42,24 +41,27 @@ button.accept-policy {
line-height: inherit;
}

/* Sticky footer styles
-------------------------------------------------- */
html {
position: relative;
min-height: 100%;
.header {
background-color: var(--bs-body-bg);
Copy link
Member

Choose a reason for hiding this comment

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

Why not inherit a background-color like before? Do we use var(--bs-body-bg) anywhere else? Is this available in Bootstrap3? Why are there no non-whitespace changes in the Bootstrap3 site.css?

}

body {
/* Margin bottom by footer height */
margin-bottom: 60px;
}
.footer {
position: absolute;
Copy link
Member

Choose a reason for hiding this comment

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

Why remove the position: absolute, width: 100, bottom: 0 for smaller width footers? Did you test on smaller screen sizes?

bottom: 0;
width: 100%;
overflow: scroll;
background-color: var(--bs-body-bg);
white-space: nowrap;
/* Set the fixed height of the footer here */
height: 60px;
line-height: 60px; /* Vertically center the text there */
line-height: 45px;
Copy link
Member

Choose a reason for hiding this comment

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

What's wrong with 60px? Why don't need the height: anymore?

}

@media (min-width: 576px) {

body {
margin-bottom: 45px;
}

.footer {
position: fixed;
bottom: 0;
width: 100%;
z-index: 9;
Copy link
Member

Choose a reason for hiding this comment

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

Why is z-index necessary? Because the footer is now fixed? Do we really want a fixed footer?

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
</environment>
</head>
<body>
<header>
<nav class="navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3">
<div class="container">
<header class="header sticky-sm-top">
<nav class="navbar navbar-expand-sm navbar-toggleable-sm border-bottom box-shadow mb-3">
<div class="container-fluid">
<a class="navbar-brand" href="~/">@Model.ApplicationName</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target=".navbar-collapse" aria-controls="navbarSupportedContent"
aria-expanded="false" aria-label="Toggle navigation">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
/* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification\
for details on configuring this project to bundle and minify static web assets. */

html {
font-size: 14px;
}

@media (min-width: 576px) {
html {
font-size: 16px;
}
}

.btn-link.nav-link:focus {
outline: black auto 1px;
}

.form-control:focus {
border-color: #0077cc;
box-shadow: 0 0 0 0.2rem #0077cc;
}

a.navbar-brand {
white-space: normal;
text-align: center;
Expand All @@ -11,11 +30,6 @@ a {
color: #0077cc;
}

.form-control:focus {
border-color: #0077cc;
box-shadow: 0 0 0 0.2rem #0077cc;
}

.btn-primary {
color: #fff;
background-color: #1b6ec2;
Expand All @@ -28,19 +42,6 @@ a {
border-color: #1861ac;
}

.btn-link.nav-link:focus {
outline: black auto 1px;
}

html {
font-size: 14px;
}
@media (min-width: 768px) {
html {
font-size: 16px;
}
}

.container {
max-width: 960px;
}
Expand All @@ -65,19 +66,27 @@ button.accept-policy {
line-height: inherit;
}

html {
position: relative;
min-height: 100%;
.header {
background-color: var(--bs-body-bg);
}

body {
margin-bottom: 60px;
}
.footer {
position: absolute;
bottom: 0;
width: 100%;
overflow: scroll;
background-color: var(--bs-body-bg);
white-space: nowrap;
line-height: 60px;
line-height: 45px;
}

@media (min-width: 576px) {

body {
margin-bottom: 45px;
}

.footer {
position: fixed;
bottom: 0;
width: 100%;
z-index: 9;
}

}