Files
godot-website/assets/css/header.css

368 lines
6.4 KiB
CSS

header {
/* Show on top of GodotCon banner (if any). */
position: relative;
z-index: 2;
height: 64px;
background-color: var(--navbar-background-color);
display: flex;
align-items: center;
box-shadow: var(--base-shadow);
.container {
overflow: initial;
width: 100%;
}
#logo-link {
/* Make the logo's clickable area as tall as for other navigation links. */
padding: 0.2rem 0.5rem;
padding-top: 6px;
margin-left: -9px;
padding-right: 15px;
margin-right: -23px;
}
}
header .container {
box-sizing: border-box;
}
header .banner-container {
width: 100%;
height: min-content;
font-family: "Montserrat", sans-serif;
}
header .banner-container .banner {
width: 100%;
height: 100%;
margin: 0.25em 0;
text-align: center;
font-weight: 400;
color: black;
gap: 0.25em;
}
header .banner-container .banner .banner-text {
display: inline-block;
margin: 0 0.25em;
}
header .banner-container .banner a {
font-weight: 600;
color: black;
text-decoration-color: black;
}
#nav, #nav_head {
.fund {
margin-right: 0px;
margin-left: 0px;
padding-left: 7px;
&.desktop {
@media (max-width: 1200px) {
display: none;
}
}
&.mobile {
top: -2px;
position: relative;
@media (min-width: 1200px) {
display: none;
}
}
a {
text-decoration: none;
color: #F35774;
color: white;
background-color: #F35774 !important;
border-radius: var(--button-border-radius);
box-shadow: inset 0 0 0 2px #F35774;
padding: 13px;
}
}
}
#nav_toggle_cb {
display: none;
}
#nav_toggle_btn {
line-height: 0px;
cursor: pointer;
user-select: none;
border-radius: 100%;
@media (min-width: 1200px) {
display: none;
}
}
.mobile-language-selector {
display: none;
}
.mobile-links {
display: grid;
grid-template-columns: 1fr 49px;
align-items: center;
@media (min-width: 1200px) {
display: none;
}
}
#nav {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
padding-left: 26px;
a {
text-decoration: none;
font-size: 16px;
font-weight: 400;
color: var(--navbar-link-color);
padding: 1.3175rem 1rem;
margin-left: 14px;
}
ul {
list-style: none;
margin: 0;
padding-left: 0;
}
a:hover, #logo-link:hover {
background-color: hsla(0, 0%, 50%, 0.1);
}
}
#nav > ul {
display: flex;
align-items: center;
height: 100%;
}
#nav > ul > :first-child {
padding-left: 0;
}
#nav > ul > :last-child {
padding-right: 0;
}
#nav > ul li {
padding-left: 1rem;
margin-bottom: 0;
margin-left: -1rem;
margin-right: -1rem;
}
#nav li.active > a {
color: var(--navbar-link-current-color);
}
#nav > ul ul {
display: none;
}
#nav_head {
display: flex;
align-items: center;
justify-content: space-between;
}
/* Dropdown menu */
.nav-dropdown-menu {
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
border-radius: 5px;
background: light-dark(#ffffffe3, #303030e3);
border: 1px solid #ffffff3b;
position: fixed;
z-index: 100;
display: none;
}
.nav-dropdown-menu a {
display: block;
padding: 0.5rem 1rem;
color: var(--navbar-link-color);
text-decoration: none;
font-size: 16px;
font-weight: 400;
white-space: nowrap;
margin: 6px;
border-radius: 4px;
min-width: 120px;
}
.nav-dropdown-menu a:hover {
background-color: hsla(0, 0%, 50%, 0.3);
}
/* Hide touch-only items on desktop (non-touch devices) */
@media (hover: hover) and (pointer: fine) {
.nav-dropdown-menu a.touch-only {
display: none;
}
}
/* Hide focus outline on dropdown triggers when dropdown is open */
[data-dropdown]:focus {
outline: none;
}
/* But restore focus outline when dropdown is closed (for keyboard navigation) */
[data-dropdown]:focus:not(.dropdown-open) {
outline: 0.125rem solid hsl(220, 100%, 62.5%);
outline-color: currentcolor;
position: relative;
}
#nav ul li.mobile-only a {
/* Indent mobile-only navigation items. */
padding-left: 3.375rem;
}
/* Hide mobile-only items on desktop */
@media (min-width: 1200px) {
.mobile-only {
display: none;
}
}
/* Mobile style */
@media (max-width: 1200px) {
.hide-on-mobile {
display: none;
}
header {
height: auto;
}
header > div {
flex-direction: column;
}
#logo-link {
margin: 0;
}
#nav_head {
width: 100%;
margin-top: 0.25rem;
}
#nav_toggle_btn {
display: block;
/* Make the navbar toggle button easier to click. */
padding: 1.25rem;
margin-top: -0.2rem;
margin-right: -1rem;
}
#nav_toggle_btn:hover {
background-color: hsla(0, 0%, 50%, 0.15);
}
#nav_toggle_btn:active {
background-color: hsla(0, 0%, 50%, 0.25);
}
#nav_toggle_cb:checked ~ header nav {
display: block;
}
#nav {
display: none;
padding-left: 0;
}
#nav ul {
align-items: flex-start;
flex-direction: column;
height: auto;
}
#nav > ul {
margin-bottom: 16px;
}
#nav ul li {
padding: 0;
padding-top: 16px;
width: 100%;
}
#nav ul a {
width: 100%;
display: block;
/* Make links easier to click but still close to each other. */
padding-top: 0.75rem;
padding-bottom: 0.75rem;
padding-left: 1.5rem;
padding-right: 1.5rem;
margin-top: -0.4375rem;
margin-bottom: -0.4375rem;
}
}
/* Language selector */
.language-selector {
background-image: none;
}
.language-option {
@media (max-width: 1200px) {
margin-left: 30px;
}
}
@media (prefers-color-scheme: dark) {
#nav_toggle_btn {
filter: invert(100%)saturate(0%)brightness(120%);
}
}
/* Language selector */
@media (min-width: 1200px) {
#nav {
.language-selector {
width: 66px;
height: 43px;
display: block;
text-align: center;
background-image: url(/assets/icons/language.svg);
background-repeat: no-repeat;
background-position: 28px 6px;
background-size: 42px;
margin-left: -10px;
cursor: pointer;
user-select: none;
@media (prefers-color-scheme: light) {
background-image: url(/assets/icons/language-light.svg);
}
}
.language-dropdown {
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 1;
border-radius: 5px;
background: #303030e3;
border: 1px solid #ffffff3b;
position: relative;
top: 50px;
width: 120px;
left: -65px;
display: none;
a {
padding: 5px 10px;
margin: 0;
display: block;
}
}
.language-selector.open .language-dropdown {
display: block;
}
.language-option {
user-select: none;
}
}
}
/* Language specific fixes */
html[lang="pl"] {
#nav a {
font-size: 15px;
}
}