Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build/lint-vars.js80
-rw-r--r--package-lock.json74
-rw-r--r--package.json3
-rw-r--r--scss/_buttons.scss4
-rw-r--r--site/docs/4.1/utilities/colors.md7
5 files changed, 78 insertions, 90 deletions
diff --git a/build/lint-vars.js b/build/lint-vars.js
deleted file mode 100644
index 8873d3670a..0000000000
--- a/build/lint-vars.js
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/usr/bin/env node
-
-/*!
- * Script to find unused Sass variables.
- * Copyright 2017-2018 The Bootstrap Authors
- * Copyright 2017-2018 Twitter, Inc.
- * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
- */
-
-const fs = require('fs')
-const path = require('path')
-const glob = require('glob')
-
-// Blame TC39... https://github.com/benjamingr/RegExp.escape/issues/37
-function regExpQuote(str) {
- return str.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&')
-}
-
-let globalSuccess = true
-
-function findUnusedVars(dir) {
- if (!(fs.existsSync(dir) && fs.statSync(dir).isDirectory())) {
- console.log(`"${dir}": Not a valid directory!`)
- process.exit(1)
- }
-
- console.log(`Finding unused variables in "${dir}"...`)
-
- // A variable to handle success/failure message in this function
- let unusedVarsFound = false
-
- // Array of all Sass files' content
- const sassFiles = glob.sync(path.join(dir, '**/*.scss'))
- // String of all Sass files' content
- let sassFilesString = ''
-
- sassFiles.forEach((file) => {
- sassFilesString += fs.readFileSync(file, 'utf8')
- })
-
- // Array of all Sass variables
- const variables = sassFilesString.match(/(^\$[a-zA-Z0-9_-]+[^:])/gm)
-
- console.log(`Found ${variables.length} total variables.`)
-
- // Loop through each variable
- variables.forEach((variable) => {
- const re = new RegExp(regExpQuote(variable), 'g')
- const count = (sassFilesString.match(re) || []).length
-
- if (count === 1) {
- console.log(`Variable "${variable}" is not being used.`)
- unusedVarsFound = true
- globalSuccess = false
- }
- })
-
- if (unusedVarsFound === false) {
- console.log(`No unused variables found in "${dir}".`)
- }
-}
-
-function main(args) {
- if (args.length < 1) {
- console.log('Wrong arguments!')
- console.log('Usage: lint-vars.js folder [, folder2...]')
- process.exit(1)
- }
-
- args.forEach((arg) => {
- findUnusedVars(arg)
- })
-
- if (globalSuccess === false) {
- process.exit(1)
- }
-}
-
-// The first and second args are: path/to/node script.js
-main(process.argv.slice(2))
diff --git a/package-lock.json b/package-lock.json
index 2c2e33e3d9..f408e25b71 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -2044,6 +2044,12 @@
"restore-cursor": "^2.0.0"
}
},
+ "cli-spinners": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-1.3.1.tgz",
+ "integrity": "sha512-1QL4544moEsDVH9T/l6Cemov/37iv1RtoKf7NJ04A60+4MREXNfx/QvavbH6QoGdsD4N4Mwy49cmaINR/o2mdg==",
+ "dev": true
+ },
"cli-table": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/cli-table/-/cli-table-0.3.1.tgz",
@@ -2087,6 +2093,12 @@
}
}
},
+ "clone": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz",
+ "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=",
+ "dev": true
+ },
"clone-regexp": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/clone-regexp/-/clone-regexp-1.0.1.tgz",
@@ -2481,6 +2493,15 @@
"os-name": "~1.0.3"
}
},
+ "defaults": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz",
+ "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=",
+ "dev": true,
+ "requires": {
+ "clone": "^1.0.2"
+ }
+ },
"define-properties": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz",
@@ -3584,6 +3605,19 @@
}
}
},
+ "find-unused-sass-variables": {
+ "version": "0.2.1",
+ "resolved": "https://registry.npmjs.org/find-unused-sass-variables/-/find-unused-sass-variables-0.2.1.tgz",
+ "integrity": "sha512-AluOKUZHVERMDSjv6SUJ+k/ad6wgpqFsU6vZOTeGk+wZiE7K77I679qyVJP8pw9gr8zHiSdFRiqnRVpXNMyW1Q==",
+ "dev": true,
+ "requires": {
+ "chalk": "^2.4.1",
+ "glob": "^7.1.3",
+ "ora": "^3.0.0",
+ "postcss": "^7.0.2",
+ "postcss-scss": "^2.0.0"
+ }
+ },
"find-up": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz",
@@ -7397,6 +7431,37 @@
"wordwrap": "~1.0.0"
}
},
+ "ora": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/ora/-/ora-3.0.0.tgz",
+ "integrity": "sha512-LBS97LFe2RV6GJmXBi6OKcETKyklHNMV0xw7BtsVn2MlsgsydyZetSCbCANr+PFLmDyv4KV88nn0eCKza665Mg==",
+ "dev": true,
+ "requires": {
+ "chalk": "^2.3.1",
+ "cli-cursor": "^2.1.0",
+ "cli-spinners": "^1.1.0",
+ "log-symbols": "^2.2.0",
+ "strip-ansi": "^4.0.0",
+ "wcwidth": "^1.0.1"
+ },
+ "dependencies": {
+ "ansi-regex": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
+ "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=",
+ "dev": true
+ },
+ "strip-ansi": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
+ "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
+ "dev": true,
+ "requires": {
+ "ansi-regex": "^3.0.0"
+ }
+ }
+ }
+ },
"os-homedir": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
@@ -11481,6 +11546,15 @@
}
}
},
+ "wcwidth": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz",
+ "integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=",
+ "dev": true,
+ "requires": {
+ "defaults": "^1.0.3"
+ }
+ },
"which": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
diff --git a/package.json b/package.json
index d9918cbc1d..d85ea56f9c 100644
--- a/package.json
+++ b/package.json
@@ -30,7 +30,7 @@
"css-copy": "shx mkdir -p site/docs/4.1/dist/ && shx cp -r dist/css/ site/docs/4.1/dist/",
"css-lint": "stylelint --syntax scss \"scss/**/*.scss\"",
"css-lint-docs": "stylelint --syntax scss \"site/docs/4.1/assets/scss/*.scss\" && stylelint \"site/docs/**/*.css\"",
- "css-lint-vars": "node build/lint-vars.js scss/ site/docs/",
+ "css-lint-vars": "fusv scss/ site/docs/",
"css-prefix": "postcss --config build/postcss.config.js --replace \"dist/css/*.css\" \"!dist/css/*.min.css\"",
"css-prefix-docs": "postcss --config build/postcss.config.js --replace \"site/docs/**/*.css\" \"site/docs/**/*.css\"",
"css-minify": "cleancss --level 1 --format breaksWith=lf --source-map --source-map-inline-sources --output dist/css/bootstrap.min.css dist/css/bootstrap.css && cleancss --level 1 --format breaksWith=lf --source-map --source-map-inline-sources --output dist/css/bootstrap-grid.min.css dist/css/bootstrap-grid.css && cleancss --level 1 --format breaksWith=lf --source-map --source-map-inline-sources --output dist/css/bootstrap-reboot.min.css dist/css/bootstrap-reboot.css",
@@ -110,6 +110,7 @@
"coveralls": "^3.0.2",
"cross-env": "^5.2.0",
"eslint": "^5.5.0",
+ "find-unused-sass-variables": "^0.2.1",
"glob": "^7.1.3",
"htmllint-cli": "^0.0.7",
"http-server": "^0.11.1",
diff --git a/scss/_buttons.scss b/scss/_buttons.scss
index e9e03a7d68..17a94c2bd7 100644
--- a/scss/_buttons.scss
+++ b/scss/_buttons.scss
@@ -82,19 +82,15 @@ fieldset:disabled a.btn {
.btn-link {
font-weight: $font-weight-normal;
color: $link-color;
- background-color: transparent;
@include hover {
color: $link-hover-color;
text-decoration: $link-hover-decoration;
- background-color: transparent;
- border-color: transparent;
}
&:focus,
&.focus {
text-decoration: $link-hover-decoration;
- border-color: transparent;
box-shadow: none;
}
diff --git a/site/docs/4.1/utilities/colors.md b/site/docs/4.1/utilities/colors.md
index 5737826448..55699adb8c 100644
--- a/site/docs/4.1/utilities/colors.md
+++ b/site/docs/4.1/utilities/colors.md
@@ -43,13 +43,10 @@ Similar to the contextual text color classes, easily set the background of an el
## Background gradient
-When `$enable-gradients` is set to true, you'll be able to use `.bg-gradient-` utility classes. **By default, `$enable-gradients` is disabled and the example below is intentionally broken.** This is done for easier customization from the moment you start using Bootstrap. [Learn about our Sass options]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/theming/#sass-options) to enable these classes and more.
+When `$enable-gradients` is set to `true` (default is `false`), you can use `.bg-gradient-` utility classes. [Learn about our Sass options]({{ site.baseurl }}/docs/{{ site.docs_version }}/getting-started/theming/#sass-options) to enable these classes and more.
-{% capture example %}
{% for color in site.data.theme-colors %}
-<div class="p-3 mb-2 bg-gradient-{{ color.name }} {% if color.name == "light" or color.name == "warning" %}text-dark{% else %}text-white{% endif %}">.bg-gradient-{{ color.name }}</div>{% endfor %}
-{% endcapture %}
-{% include example.html content=example %}
+- `.bg-gradient-{{ color.name }}`{% endfor %}
{% capture callout %}
#### Dealing with specificity