foundation.mozilla.org/source/sass/components/primary-nav.scss

327 строки
6.5 KiB
SCSS
Исходник Обычный вид История

// Primary Nav (Site Nav)
.primary-nav-container {
$logo-height: 28px;
$menu-container-padding: (
md: 16px,
);
$primary-nav-link-padding: (
xs: 18px,
sm: 22px,
md: 9px,
);
&.zen-mode {
.menu-container {
@media (min-width: $bp-md) {
padding-left: 52px;
padding-right: 52px;
}
}
}
.menu-container {
padding: 0 0 0 52px;
@media (min-width: $bp-md) {
padding: map-get($menu-container-padding, md) 0;
}
}
Pni v4 2020 rebased (#5579) * test * rebase * Make category page extend homepage template (#5460) * make category page extend homepage template * refactor further * rename * PNI hero changes (#5488) * PNI hero changes * styling fixes * forgot to add image file * rebase * 1. 3 page types for PNI products (#5523) * 3 page types for PNI products * Review/suggested changes * remove MSS badge and add ding to product thumbnails (#5535) * Add created_date field to Products (#5474) * Add created_date field to products * Update.created_date field with default of Jan 1, 2020 * Default to Jan 1 2020, auto_now new Updates * Update network-api/networkapi/buyersguide/migrations/0007_update_created_date.py Co-authored-by: Pomax <pomax@nihongoresources.com> * Update network-api/networkapi/buyersguide/pagemodels/product_update.py Co-authored-by: Pomax <pomax@nihongoresources.com> * Removed unused import * Update network-api/networkapi/buyersguide/migrations/0007_update_created_date.py Co-authored-by: Pomax <pomax@nihongoresources.com> * Update network-api/networkapi/buyersguide/migrations/0007_update_created_date.py Co-authored-by: Pomax <pomax@nihongoresources.com> * Update network-api/networkapi/buyersguide/pagemodels/product_update.py Co-authored-by: Pomax <pomax@nihongoresources.com> * Migration fix Co-authored-by: Pomax <pomax@nihongoresources.com> * 2. Add Orderables to ProductPages (converted from m2m fields) (#5529) * Orderables added to product pages * Applied suggestions from code review * Suggested review changes & migration fix * Delete cloudinary_image from Pages that have that field (#5534) * Make mobile primary nav work on PNI (#5540) * make mobile primary nav work on PNI * mobile active nav link * fix regression - category nav should locate below the hero * fix broken script * remove extra padding around nav logo * override default wide_screen_menu block content * replace random z-index value with Bootstrap var * Added borders to the Security area (#5542) * Added borders * I should know better by now * Ran inv test-node * Fixed top spacing for MSS ding * Search filter (#5501) * initial functionality and super basic css initial functionality and super basic css ... ... linting Update source/js/buyers-guide/search.js Co-authored-by: Mavis Ou <mmmavis@users.noreply.github.com> Update source/js/buyers-guide/search.js Co-authored-by: Mavis Ou <mmmavis@users.noreply.github.com> Update source/js/buyers-guide/search.js Co-authored-by: Mavis Ou <mmmavis@users.noreply.github.com> * PR fixes * refinements: * pre-making-things-flex * mostly done? This thing is kicking my ass... * rogue console logs * PR notes * . * Update admin.css * Update __init__.py * Delete search.svg wrong icon * Delete dismiss.svg wrong icon * recheck result count on pni-checkbox * PR fixes... hopefully? * . * svgo * svgo * svgo * 5423 search results (#5550) * No search results w/ emoji * Hide Submit A Product on category pages when no search results are found * Ran inv test-node * Code review fixes * Update network-api/networkapi/buyersguide/templates/fragments/no_search_results.html Co-authored-by: Mavis Ou <mmmavis@users.noreply.github.com> * Update network-api/networkapi/buyersguide/templates/fragments/no_search_results.html Co-authored-by: Mavis Ou <mmmavis@users.noreply.github.com> Co-authored-by: Kalob Taulien <kalob.taulien@gmail.com> Co-authored-by: Kalob Taulien <4743971+KalobTaulien@users.noreply.github.com> Co-authored-by: Mavis Ou <mmmavis@users.noreply.github.com> * PR update * localized string * text sizing Co-authored-by: Mavis Ou <mmmavis@users.noreply.github.com> Co-authored-by: Kalob Taulien <kalob.taulien@gmail.com> Co-authored-by: Kalob Taulien <4743971+KalobTaulien@users.noreply.github.com> * update page title for category pages and about pages (#5547) * Mobile category nav (#5551) * repurpose foundation's site mobile 'multipage-nav' for PNI & add styling overrides to suit our needs * design tweaks * adjust mobile category nav's padding * fix padding in another way * Recolor creep-bubble and add new text (#5558) * updated the search bar to match the styling indicated in our new v4 designs Co-authored-by: Kalob Taulien <kalob.taulien@gmail.com> * hide any product older than October 29th, 2020 (#5560) * Move creepo-face to bottom corner on scroll; fadein/fadeout (#5561) * Move creepo-face to bottom corner on scroll; fadein/fadeout * Offset when creepo face is moved on desktop * Move creepo-meter permanently when starting to ssearch on desktop * Check if elements exist; moved node lookups; using class based lookups * Fixes overlay bug on mobile * Pni improvements 5571 (#5573) * minor improvements * minor improvements * increase 'hit' area for icon * update PNI fake product review dates Co-authored-by: Mavis Ou <mmmavis@users.noreply.github.com> Co-authored-by: Kalob Taulien <4743971+KalobTaulien@users.noreply.github.com> Co-authored-by: Kalob Taulien <kalob.taulien@gmail.com>
2020-11-05 21:00:26 +03:00
.primary-nav-special-link {
2022-06-01 10:49:24 +03:00
font-size: 17px;
line-height: calc(23 / 17);
color: $black;
font-weight: $btn-font-weight;
&.pni-nav-link {
text-decoration: none;
2022-09-20 10:08:24 +03:00
&.active,
&:hover {
text-decoration: wavy $pni-wavy-blue 2px underline;
text-underline-offset: 0.5rem;
2022-09-20 10:08:24 +03:00
color: $dark-blue;
}
}
Pni v4 2020 rebased (#5579) * test * rebase * Make category page extend homepage template (#5460) * make category page extend homepage template * refactor further * rename * PNI hero changes (#5488) * PNI hero changes * styling fixes * forgot to add image file * rebase * 1. 3 page types for PNI products (#5523) * 3 page types for PNI products * Review/suggested changes * remove MSS badge and add ding to product thumbnails (#5535) * Add created_date field to Products (#5474) * Add created_date field to products * Update.created_date field with default of Jan 1, 2020 * Default to Jan 1 2020, auto_now new Updates * Update network-api/networkapi/buyersguide/migrations/0007_update_created_date.py Co-authored-by: Pomax <pomax@nihongoresources.com> * Update network-api/networkapi/buyersguide/pagemodels/product_update.py Co-authored-by: Pomax <pomax@nihongoresources.com> * Removed unused import * Update network-api/networkapi/buyersguide/migrations/0007_update_created_date.py Co-authored-by: Pomax <pomax@nihongoresources.com> * Update network-api/networkapi/buyersguide/migrations/0007_update_created_date.py Co-authored-by: Pomax <pomax@nihongoresources.com> * Update network-api/networkapi/buyersguide/pagemodels/product_update.py Co-authored-by: Pomax <pomax@nihongoresources.com> * Migration fix Co-authored-by: Pomax <pomax@nihongoresources.com> * 2. Add Orderables to ProductPages (converted from m2m fields) (#5529) * Orderables added to product pages * Applied suggestions from code review * Suggested review changes & migration fix * Delete cloudinary_image from Pages that have that field (#5534) * Make mobile primary nav work on PNI (#5540) * make mobile primary nav work on PNI * mobile active nav link * fix regression - category nav should locate below the hero * fix broken script * remove extra padding around nav logo * override default wide_screen_menu block content * replace random z-index value with Bootstrap var * Added borders to the Security area (#5542) * Added borders * I should know better by now * Ran inv test-node * Fixed top spacing for MSS ding * Search filter (#5501) * initial functionality and super basic css initial functionality and super basic css ... ... linting Update source/js/buyers-guide/search.js Co-authored-by: Mavis Ou <mmmavis@users.noreply.github.com> Update source/js/buyers-guide/search.js Co-authored-by: Mavis Ou <mmmavis@users.noreply.github.com> Update source/js/buyers-guide/search.js Co-authored-by: Mavis Ou <mmmavis@users.noreply.github.com> * PR fixes * refinements: * pre-making-things-flex * mostly done? This thing is kicking my ass... * rogue console logs * PR notes * . * Update admin.css * Update __init__.py * Delete search.svg wrong icon * Delete dismiss.svg wrong icon * recheck result count on pni-checkbox * PR fixes... hopefully? * . * svgo * svgo * svgo * 5423 search results (#5550) * No search results w/ emoji * Hide Submit A Product on category pages when no search results are found * Ran inv test-node * Code review fixes * Update network-api/networkapi/buyersguide/templates/fragments/no_search_results.html Co-authored-by: Mavis Ou <mmmavis@users.noreply.github.com> * Update network-api/networkapi/buyersguide/templates/fragments/no_search_results.html Co-authored-by: Mavis Ou <mmmavis@users.noreply.github.com> Co-authored-by: Kalob Taulien <kalob.taulien@gmail.com> Co-authored-by: Kalob Taulien <4743971+KalobTaulien@users.noreply.github.com> Co-authored-by: Mavis Ou <mmmavis@users.noreply.github.com> * PR update * localized string * text sizing Co-authored-by: Mavis Ou <mmmavis@users.noreply.github.com> Co-authored-by: Kalob Taulien <kalob.taulien@gmail.com> Co-authored-by: Kalob Taulien <4743971+KalobTaulien@users.noreply.github.com> * update page title for category pages and about pages (#5547) * Mobile category nav (#5551) * repurpose foundation's site mobile 'multipage-nav' for PNI & add styling overrides to suit our needs * design tweaks * adjust mobile category nav's padding * fix padding in another way * Recolor creep-bubble and add new text (#5558) * updated the search bar to match the styling indicated in our new v4 designs Co-authored-by: Kalob Taulien <kalob.taulien@gmail.com> * hide any product older than October 29th, 2020 (#5560) * Move creepo-face to bottom corner on scroll; fadein/fadeout (#5561) * Move creepo-face to bottom corner on scroll; fadein/fadeout * Offset when creepo face is moved on desktop * Move creepo-meter permanently when starting to ssearch on desktop * Check if elements exist; moved node lookups; using class based lookups * Fixes overlay bug on mobile * Pni improvements 5571 (#5573) * minor improvements * minor improvements * increase 'hit' area for icon * update PNI fake product review dates Co-authored-by: Mavis Ou <mmmavis@users.noreply.github.com> Co-authored-by: Kalob Taulien <4743971+KalobTaulien@users.noreply.github.com> Co-authored-by: Kalob Taulien <kalob.taulien@gmail.com>
2020-11-05 21:00:26 +03:00
@media (min-width: $bp-md) {
&:not(:last-of-type) {
margin-right: 1rem;
}
}
&:hover {
color: $dark-blue;
}
}
#primary-nav-links {
// Mixin for setting vertical padding on primary #primary-nav-links
@mixin link-padding($v-padding: xs) {
padding-top: $v-padding;
padding-bottom: $v-padding;
}
@include link-padding(map-get($primary-nav-link-padding, xs));
@media (min-width: $bp-sm) {
@include link-padding(map-get($primary-nav-link-padding, sm));
}
@media (min-width: $bp-md) {
@include link-padding(map-get($primary-nav-link-padding, md));
}
}
.nav-links {
a {
$border-thickness: 6px;
border-bottom: 6px solid transparent;
color: $black;
font-weight: 700;
margin-right: 18px;
transition: border-color 0.25s ease;
// Mixin for setting bottom padding on primary nav link
@mixin padding-bottom($bp: sm) {
padding-bottom: calc(
#{map-get($menu-container-padding, $bp)} + #{map-get(
$primary-nav-link-padding,
$bp
)} - #{$border-thickness} / 2
);
}
@media (min-width: $bp-sm) {
@include padding-bottom(sm);
}
@media (min-width: $bp-md) {
@include padding-bottom(md);
}
2022-06-01 10:49:24 +03:00
font-size: 17px;
line-height: calc(23 / 17);
@include hover-focus-active {
text-decoration: none;
border-bottom-color: $gray-20;
}
&.active {
border-color: $black;
}
}
}
.wrapper-burger {
transition: background 200ms ease-in-out;
background: $white;
border-bottom: 1px solid $gray-20;
.wide-screen-menu {
line-height: $logo-height; //Tied to logo height so that the "active" page border shows up at the correct alignment consistently
&.hidden {
opacity: 0;
transform: translateY(8px);
visibility: hidden;
transition: opacity 0.15s, transform 0.15s, visibility 0s linear 0.15s;
}
transition: opacity 0.15s, transform 0.15s, visibility 0s;
}
.burger {
margin-right: 24px;
margin-left: -52px;
border: 0;
background: transparent;
width: 28px;
height: 28px;
padding: 0;
position: relative;
z-index: 1;
.burger-bar {
position: absolute;
background: $black;
height: 3px;
width: 28px;
&.burger-bar-top {
top: 3px;
width: 16px;
}
&.burger-bar-middle {
top: 12.5px;
}
&.burger-bar-bottom {
top: 22px;
width: 23px;
}
transition: top 0.1s linear 0.1s, width 0.1s linear 0.1s, transform 0.1s;
}
&.menu-open {
.burger-bar {
&.burger-bar-top {
top: 12.5px;
width: 28px;
transform: rotate(135deg);
}
&.burger-bar-middle {
transform: rotate(135deg);
}
&.burger-bar-bottom {
top: 12.5px;
width: 28px;
transform: rotate(45deg);
}
transition: top 0.1s, width 0.1s, transform 0.1s linear 0.1s;
}
}
outline: 0;
}
&.scrolled {
background: $white;
box-shadow: 0 1px 3px $border-shadow-color;
}
.center-nav-title p {
text-transform: uppercase;
margin: 0;
padding: 0;
color: $black;
letter-spacing: 1px;
line-height: 24px;
}
.logo {
width: 28px;
height: $logo-height;
background: url(../_images/mozilla-m.svg) no-repeat;
background-size: contain;
position: relative;
z-index: 1;
@media (min-width: $nav-full-logo-breakpoint) {
width: 97px;
background: url(../_images/mozilla-on-black.svg) no-repeat;
}
margin: 0 26px 0 0;
padding: 0;
line-height: 0;
}
.narrow-screen-menu {
position: absolute;
padding-top: 64px;
@media (min-width: $nav-full-logo-breakpoint) {
padding-top: 72px;
}
height: 100vh;
top: 0;
left: 0;
width: 100%;
transition: opacity 0.2s, height 0s;
&.hidden {
opacity: 0;
height: 0;
overflow: hidden;
transition: opacity 0.2s, height 0s linear 0.2s;
.nav-links {
a {
transform: translateY(8px);
}
}
}
.narrow-screen-menu-container {
padding: 0 52px;
}
.narrow-screen-menu-background {
background: $black;
height: 100%;
}
.nav-links {
height: 100%;
a {
font-weight: 500;
transition: transform 0.15s;
display: inline-block;
margin: 10px 0;
padding-bottom: 0;
border-width: 0px 0px 3px 0px;
color: $white;
@include hover-focus-active {
border-bottom-color: $white;
}
&.active {
border-bottom-color: $white;
}
}
}
}
}
}
// Newsletter
#nav-newsletter-form-wrapper {
background-color: $black;
opacity: 0;
height: 0;
overflow-y: hidden;
transition: height 0.3s ease-in-out, opacity 0.2s ease-in-out;
@media (min-width: $bp-lg) {
opacity: 1;
position: absolute;
left: 0;
right: 0;
}
&.expanded {
opacity: 1;
height: 300px;
z-index: 100;
}
&.faded-in {
opacity: 1;
height: 100%;
}
}
/* TODO:FIXME: custom button style introduced */
.btn.form-dismiss {
color: $light-blue;
border: none;
background: transparent;
@include hover-focus-active {
text-decoration: underline;
}
}