From 9d347dc5d042b1545a63d2ccd58cfba484543c8e Mon Sep 17 00:00:00 2001 From: Yufei Huang Date: Wed, 17 May 2023 16:42:12 +0800 Subject: [PATCH] fix: lint --- templates/.stylelintrc.json | 3 +-- templates/modern/src/docfx.scss | 37 ++++++++--------------------- templates/modern/src/highlight.scss | 5 ++-- templates/modern/src/mixins.scss | 22 +++++++++++++++++ 4 files changed, 36 insertions(+), 31 deletions(-) create mode 100644 templates/modern/src/mixins.scss diff --git a/templates/.stylelintrc.json b/templates/.stylelintrc.json index 856d46a1e01..3b9e6628a43 100644 --- a/templates/.stylelintrc.json +++ b/templates/.stylelintrc.json @@ -1,8 +1,7 @@ { "extends": "stylelint-config-standard-scss", "ignoreFiles": [ - "**/*.ts", - "**/docfx.scss" + "**/*.ts" ], "rules": { "selector-class-pattern": null, diff --git a/templates/modern/src/docfx.scss b/templates/modern/src/docfx.scss index 0665fdf49a6..fb06bd300bf 100644 --- a/templates/modern/src/docfx.scss +++ b/templates/modern/src/docfx.scss @@ -4,13 +4,19 @@ */ $enable-important-utilities: false; - $container-max-widths: ( xxl: 1768px ) !default; -@import "bootstrap/scss/bootstrap.scss"; -@import "highlight.scss"; +@import "mixins"; +@import "bootstrap/scss/bootstrap"; +@import "highlight"; +@import "layout"; +@import "nav"; +@import "toc"; +@import "markdown"; +@import "search"; +@import "dotnet"; h1, h2, @@ -49,7 +55,7 @@ article { max-height: 200px; } -@media (max-width: 768px) { +@media (width <= 768px) { #mobile-indicator { display: block; } @@ -67,26 +73,3 @@ article { display: none; } } - -@mixin adjust-icon { - font-family: bootstrap-icons; - position: relative; - margin-right: 0.5em; - top: 0.2em; - font-size: 1.25em; - font-weight: normal; -} - -@mixin underline-on-hover { - text-decoration: none; - &:hover, &:focus { - text-decoration: underline; - } -} - -@import "layout.scss"; -@import "nav.scss"; -@import "toc.scss"; -@import "markdown.scss"; -@import "search.scss"; -@import "dotnet.scss"; diff --git a/templates/modern/src/highlight.scss b/templates/modern/src/highlight.scss index febeda05aaa..97ae2d845eb 100644 --- a/templates/modern/src/highlight.scss +++ b/templates/modern/src/highlight.scss @@ -3,10 +3,11 @@ * Licensed under the MIT License. See License.txt in the project root for license information. */ -@import "highlight.js/scss/vs.scss"; +@import "highlight.js/scss/vs"; @include color-mode(dark) { - @import "highlight.js/scss/vs2015.scss"; + /* stylelint-disable-next-line no-invalid-position-at-import-rule */ + @import "highlight.js/scss/vs2015"; } .hljs { diff --git a/templates/modern/src/mixins.scss b/templates/modern/src/mixins.scss new file mode 100644 index 00000000000..6f748b6b93e --- /dev/null +++ b/templates/modern/src/mixins.scss @@ -0,0 +1,22 @@ +/** + * Copyright (c) Microsoft Corporation. All Rights Reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. +*/ + +@mixin adjust-icon { + font-family: bootstrap-icons; + position: relative; + margin-right: 0.5em; + top: 0.2em; + font-size: 1.25em; + font-weight: normal; + } + + @mixin underline-on-hover { + text-decoration: none; + + &:hover, &:focus { + text-decoration: underline; + } + } + \ No newline at end of file