Skip to content

Commit

Permalink
suppress font-family-no-missing-generic-family-keyword for bootstrap-…
Browse files Browse the repository at this point in the history
…icons
  • Loading branch information
yufeih committed Mar 19, 2023
1 parent 5a04cb5 commit da22fef
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 17 deletions.
7 changes: 6 additions & 1 deletion templates/.stylelintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
"**/docfx.scss"
],
"rules": {
"selector-class-pattern": null
"selector-class-pattern": null,
"font-family-no-missing-generic-family-keyword": [ true, {
"ignoreFontFamilies": [
"bootstrap-icons"
]
}]
}
}
2 changes: 1 addition & 1 deletion templates/modern/src/docfx.scss
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ article {
}

@mixin adjust-icon {
font-family: bootstrap-icons, sans-serif;
font-family: bootstrap-icons;
position: relative;
margin-right: 0.5em;
top: 0.2em;
Expand Down
4 changes: 2 additions & 2 deletions templates/modern/src/markdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@

/* External link icon */
a.external[href]::after {
font-family: bootstrap-icons, sans-serif;
font-family: bootstrap-icons;
content: "\F1C5";
font-size: .65em;
font-size: .6rem;
margin: 0 .2em;
display: inline-block;
}
Expand Down
24 changes: 12 additions & 12 deletions templates/modern/src/markdown.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

import { breakWord, meta } from './helper'
import { breakWord } from './helper'
import AnchorJs from 'anchor-js'
import { html, render } from 'lit-html'

Expand Down Expand Up @@ -161,25 +161,25 @@ function renderTabs() {
type: 'data-bi-type'
}

const Tab = (function () {
const Tab = (function() {
function Tab(li, a, section) {
this.li = li
this.a = a
this.section = section
}
Object.defineProperty(Tab.prototype, 'tabIds', {
get: function () { return this.a.getAttribute('data-tab').split(' ') },
get: function() { return this.a.getAttribute('data-tab').split(' ') },
enumerable: true,
configurable: true
})
Object.defineProperty(Tab.prototype, 'condition', {
get: function () { return this.a.getAttribute('data-condition') },
get: function() { return this.a.getAttribute('data-condition') },
enumerable: true,
configurable: true
})
Object.defineProperty(Tab.prototype, 'visible', {
get: function () { return !this.li.hasAttribute('hidden') },
set: function (value) {
get: function() { return !this.li.hasAttribute('hidden') },
set: function(value) {
if (value) {
this.li.removeAttribute('hidden')
this.li.removeAttribute('aria-hidden')
Expand All @@ -192,8 +192,8 @@ function renderTabs() {
configurable: true
})
Object.defineProperty(Tab.prototype, 'selected', {
get: function () { return !this.section.hasAttribute('hidden') },
set: function (value) {
get: function() { return !this.section.hasAttribute('hidden') },
set: function(value) {
if (value) {
this.a.setAttribute('aria-selected', 'true')
this.a.classList.add('active')
Expand All @@ -211,7 +211,7 @@ function renderTabs() {
enumerable: true,
configurable: true
})
Tab.prototype.focus = function () {
Tab.prototype.focus = function() {
this.a.focus()
}
return Tab
Expand All @@ -230,7 +230,7 @@ function renderTabs() {
state.groups.push(group)
}
}
container.addEventListener('click', function (event) { return handleClick(event, state) })
container.addEventListener('click', function(event) { return handleClick(event, state) })
if (state.groups.length === 0) {
return state
}
Expand Down Expand Up @@ -315,7 +315,7 @@ function renderTabs() {
}
event.preventDefault()
info.anchor.href = 'javascript:'
setTimeout(function () {
setTimeout(function() {
info.anchor.href = '#' + info.anchor.getAttribute('aria-controls')
})
const tabIds = info.tabIds; const group = info.group
Expand All @@ -329,7 +329,7 @@ function renderTabs() {
if (arraysIntersect(state.selectedTabs, tabIds)) {
return
}
const previousTabId = group.tabs.filter(function (t) { return t.selected })[0].tabIds[0]
const previousTabId = group.tabs.filter(function(t) { return t.selected })[0].tabIds[0]
state.selectedTabs.splice(state.selectedTabs.indexOf(previousTabId), 1, tabIds[0])
for (let _b = 0, _c = state.groups; _b < _c.length; _b++) {
const group1 = _c[_b]
Expand Down
2 changes: 1 addition & 1 deletion templates/modern/src/toc.scss
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ $expand-stub-width: 1.2rem;
display: inline-block;
width: $expand-stub-width;
cursor: pointer;
font-family: bootstrap-icons, sans-serif;
font-family: bootstrap-icons;
content: "\F285";
position: absolute;
margin-left: -$expand-stub-width;
Expand Down

0 comments on commit da22fef

Please sign in to comment.