From f3e1e3ff01c764d0dd34c4cee11f21b3de84a5dc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= <emilio@crisal.io>
Date: Sun, 8 Oct 2023 22:33:39 +0000
Subject: [PATCH] Bug 1857522 - Reduce max nesting depth to 3. r=Gijs

That still doesn't trigger on the code in comment 2, so that is a bit
confusing and needs investigation.

Differential Revision: https://phabricator.services.mozilla.com/D190310
---
 .stylelintignore                                                | 1 +
 .stylelintrc.js                                                 | 2 +-
 .../newtab/content-src/aboutwelcome/aboutwelcome.scss           | 2 ++
 .../content-src/components/ASRouterAdmin/ASRouterAdmin.scss     | 2 ++
 .../components/newtab/content-src/components/Card/_Card.scss    | 2 ++
 .../components/CollapsibleSection/_CollapsibleSection.scss      | 2 ++
 .../newtab/content-src/components/ContextMenu/_ContextMenu.scss | 2 ++
 .../DiscoveryStreamComponents/Highlights/_Highlights.scss       | 2 ++
 .../DiscoveryStreamComponents/Navigation/_Navigation.scss       | 2 ++
 .../DiscoveryStreamComponents/TopSites/_TopSites.scss           | 2 ++
 .../DiscoveryStreamComponents/TopicsWidget/_TopicsWidget.scss   | 2 ++
 .../newtab/content-src/components/TopSites/_TopSites.scss       | 2 ++
 .../components/newtab/content-src/styles/_feature-callout.scss  | 2 ++
 browser/components/newtab/content-src/styles/_shopping.scss     | 2 ++
 browser/components/pocket/content/panels/css/home.scss          | 2 ++
 15 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/.stylelintignore b/.stylelintignore
index 9ffc1c4a5003c..f4053e45e53d8 100644
--- a/.stylelintignore
+++ b/.stylelintignore
@@ -83,6 +83,7 @@ python/mozbuild/mozbuild/test/backend/data/build/foo.css
 
 # This is third-party in a way:
 toolkit/components/pdfjs/content/web/debugger.css
+toolkit/components/pdfjs/content/web/viewer.css
 
 # Ignore web-platform tests as they are not necessarily under our control.
 testing/web-platform/tests/
diff --git a/.stylelintrc.js b/.stylelintrc.js
index 5d36f9314aa87..3dcef1e243d5b 100644
--- a/.stylelintrc.js
+++ b/.stylelintrc.js
@@ -54,7 +54,7 @@ module.exports = {
     ],
 
     "max-nesting-depth": [
-      8,
+      3,
       {
         ignore: ["blockless-at-rules", "pseudo-classes"],
       },
diff --git a/browser/components/newtab/content-src/aboutwelcome/aboutwelcome.scss b/browser/components/newtab/content-src/aboutwelcome/aboutwelcome.scss
index 44d782a8a3174..43fc380585645 100644
--- a/browser/components/newtab/content-src/aboutwelcome/aboutwelcome.scss
+++ b/browser/components/newtab/content-src/aboutwelcome/aboutwelcome.scss
@@ -6,6 +6,8 @@
 @import '../styles/feature-callout';
 @import '../styles/shopping';
 
+/* stylelint-disable max-nesting-depth */
+
 $break-point-small: 570px;
 $break-point-medium: 610px;
 $break-point-large: 866px;
diff --git a/browser/components/newtab/content-src/components/ASRouterAdmin/ASRouterAdmin.scss b/browser/components/newtab/content-src/components/ASRouterAdmin/ASRouterAdmin.scss
index b095b94ef6afc..085196a4ee2c5 100644
--- a/browser/components/newtab/content-src/components/ASRouterAdmin/ASRouterAdmin.scss
+++ b/browser/components/newtab/content-src/components/ASRouterAdmin/ASRouterAdmin.scss
@@ -1,3 +1,5 @@
+/* stylelint-disable max-nesting-depth */
+
 .asrouter-toggle {
   position: fixed;
   top: 50px;
diff --git a/browser/components/newtab/content-src/components/Card/_Card.scss b/browser/components/newtab/content-src/components/Card/_Card.scss
index 0c363b52d84f7..74288ff07fe40 100644
--- a/browser/components/newtab/content-src/components/Card/_Card.scss
+++ b/browser/components/newtab/content-src/components/Card/_Card.scss
@@ -1,5 +1,7 @@
 @use 'sass:math';
 
+/* stylelint-disable max-nesting-depth */
+
 .card-outer {
   @include context-menu-button;
 
diff --git a/browser/components/newtab/content-src/components/CollapsibleSection/_CollapsibleSection.scss b/browser/components/newtab/content-src/components/CollapsibleSection/_CollapsibleSection.scss
index 9811339b27d18..10cc58a1b1bb0 100644
--- a/browser/components/newtab/content-src/components/CollapsibleSection/_CollapsibleSection.scss
+++ b/browser/components/newtab/content-src/components/CollapsibleSection/_CollapsibleSection.scss
@@ -1,3 +1,5 @@
+/* stylelint-disable max-nesting-depth */
+
 .collapsible-section {
   padding: $section-vertical-padding $section-horizontal-padding;
 
diff --git a/browser/components/newtab/content-src/components/ContextMenu/_ContextMenu.scss b/browser/components/newtab/content-src/components/ContextMenu/_ContextMenu.scss
index c0074128e696a..e3192a944c205 100644
--- a/browser/components/newtab/content-src/components/ContextMenu/_ContextMenu.scss
+++ b/browser/components/newtab/content-src/components/ContextMenu/_ContextMenu.scss
@@ -1,5 +1,7 @@
 @use 'sass:math';
 
+/* stylelint-disable max-nesting-depth */
+
 .context-menu {
   background: var(--newtab-background-color-secondary);
   border-radius: $context-menu-border-radius;
diff --git a/browser/components/newtab/content-src/components/DiscoveryStreamComponents/Highlights/_Highlights.scss b/browser/components/newtab/content-src/components/DiscoveryStreamComponents/Highlights/_Highlights.scss
index 3c5b60e946bab..54b39524d8388 100644
--- a/browser/components/newtab/content-src/components/DiscoveryStreamComponents/Highlights/_Highlights.scss
+++ b/browser/components/newtab/content-src/components/DiscoveryStreamComponents/Highlights/_Highlights.scss
@@ -1,3 +1,5 @@
+/* stylelint-disable max-nesting-depth */
+
 .ds-highlights {
   .section {
     .section-list {
diff --git a/browser/components/newtab/content-src/components/DiscoveryStreamComponents/Navigation/_Navigation.scss b/browser/components/newtab/content-src/components/DiscoveryStreamComponents/Navigation/_Navigation.scss
index f9b5e5c704335..0c7a158efbf14 100644
--- a/browser/components/newtab/content-src/components/DiscoveryStreamComponents/Navigation/_Navigation.scss
+++ b/browser/components/newtab/content-src/components/DiscoveryStreamComponents/Navigation/_Navigation.scss
@@ -1,3 +1,5 @@
+/* stylelint-disable max-nesting-depth */
+
 .ds-navigation {
   color: var(--newtab-text-primary-color);
   font-size: 11.5px;
diff --git a/browser/components/newtab/content-src/components/DiscoveryStreamComponents/TopSites/_TopSites.scss b/browser/components/newtab/content-src/components/DiscoveryStreamComponents/TopSites/_TopSites.scss
index e0c7c1a8ebd83..4e9d6c33836fd 100644
--- a/browser/components/newtab/content-src/components/DiscoveryStreamComponents/TopSites/_TopSites.scss
+++ b/browser/components/newtab/content-src/components/DiscoveryStreamComponents/TopSites/_TopSites.scss
@@ -1,3 +1,5 @@
+/* stylelint-disable max-nesting-depth */
+
 .outer-wrapper {
   .ds-top-sites {
     .top-sites {
diff --git a/browser/components/newtab/content-src/components/DiscoveryStreamComponents/TopicsWidget/_TopicsWidget.scss b/browser/components/newtab/content-src/components/DiscoveryStreamComponents/TopicsWidget/_TopicsWidget.scss
index d05d46cd071a2..4f8b5740e24d5 100644
--- a/browser/components/newtab/content-src/components/DiscoveryStreamComponents/TopicsWidget/_TopicsWidget.scss
+++ b/browser/components/newtab/content-src/components/DiscoveryStreamComponents/TopicsWidget/_TopicsWidget.scss
@@ -1,3 +1,5 @@
+/* stylelint-disable max-nesting-depth */
+
 .ds-topics-widget {
   display: flex;
   position: relative;
diff --git a/browser/components/newtab/content-src/components/TopSites/_TopSites.scss b/browser/components/newtab/content-src/components/TopSites/_TopSites.scss
index b893b6b33eb89..ee75fc1233e28 100644
--- a/browser/components/newtab/content-src/components/TopSites/_TopSites.scss
+++ b/browser/components/newtab/content-src/components/TopSites/_TopSites.scss
@@ -1,5 +1,7 @@
 @use 'sass:math';
 
+/* stylelint-disable max-nesting-depth */
+
 $top-sites-size: $grid-unit-small;
 $top-sites-border-radius: 8px;
 $top-sites-icon-border-radius: 4px;
diff --git a/browser/components/newtab/content-src/styles/_feature-callout.scss b/browser/components/newtab/content-src/styles/_feature-callout.scss
index d31ac6b394a83..427912777bcc8 100644
--- a/browser/components/newtab/content-src/styles/_feature-callout.scss
+++ b/browser/components/newtab/content-src/styles/_feature-callout.scss
@@ -4,6 +4,8 @@
 
 @import 'feature-callout-theme';
 
+/* stylelint-disable max-nesting-depth */
+
 #feature-callout {
   // See _feature-callout-theme.scss for the theme mixins and
   // FeatureCallout.sys.mjs for the color values
diff --git a/browser/components/newtab/content-src/styles/_shopping.scss b/browser/components/newtab/content-src/styles/_shopping.scss
index b0f60199b96ad..e9649ced5ee9e 100644
--- a/browser/components/newtab/content-src/styles/_shopping.scss
+++ b/browser/components/newtab/content-src/styles/_shopping.scss
@@ -2,6 +2,8 @@
 // License, v. 2.0. If a copy of the MPL was not distributed with this
 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+/* stylelint-disable max-nesting-depth */
+
 .onboardingContainer.shopping {
   height: auto;
 
diff --git a/browser/components/pocket/content/panels/css/home.scss b/browser/components/pocket/content/panels/css/home.scss
index 9780963feebfd..af0849708bbb1 100644
--- a/browser/components/pocket/content/panels/css/home.scss
+++ b/browser/components/pocket/content/panels/css/home.scss
@@ -1,3 +1,5 @@
+/* stylelint-disable max-nesting-depth */
+
 .pkt_ext_containerhome,
 .pkt_ext_wrapperhome {
   overflow: hidden;
-- 
GitLab