Skip to content

Commit

Permalink
Merge branch 'main' into search-query-filter
Browse files Browse the repository at this point in the history
  • Loading branch information
korki43 committed Mar 26, 2023
2 parents 4f155da + a84ae7c commit 06789f3
Show file tree
Hide file tree
Showing 76 changed files with 2,345 additions and 8,072 deletions.
14 changes: 13 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,17 @@
"never"
],
"strict": "error"
}
},
"overrides": [
{
"files": "docs/**",
"env": {
"browser": true,
"node": false
},
"parserOptions": {
"sourceType": "script"
}
}
]
}
14 changes: 5 additions & 9 deletions .fantasticonrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
const codepoints = require('./font/bootstrap-icons.json')

module.exports = {
inputDir: './icons', // (required)
outputDir: './font', // (required)
inputDir: './icons',
outputDir: './font',
fontTypes: ['woff2', 'woff'],
assetTypes: ['css', 'scss', 'json'],
name: 'bootstrap-icons',
Expand All @@ -17,20 +17,16 @@ module.exports = {
indent: 2
}
},
// Use a custom Handlebars template
// Use our custom Handlebars templates
templates: {
css: './build/font/css.hbs',
scss: './build/font/scss.hbs',
html: './build/font/html.hbs'
scss: './build/font/scss.hbs'
},
pathOptions: {
json: './font/bootstrap-icons.json',
css: './font/bootstrap-icons.css',
scss: './font/bootstrap-icons.scss',
html: './font/index.html',
ttf: './font/fonts/bootstrap-icons.ttf',
woff: './font/fonts/bootstrap-icons.woff',
woff2: './font/fonts/bootstrap-icons.woff2',
eot: './font/fonts/bootstrap-icons.eot'
woff2: './font/fonts/bootstrap-icons.woff2'
}
}
15 changes: 4 additions & 11 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: monthly
- package-ecosystem: npm
directory: "/"
schedule:
interval: monthly
time: "12:00"
timezone: Europe/Athens
open-pull-requests-limit: 10
reviewers:
- XhmikosR
labels:
- dependencies
versioning-strategy: increase
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: monthly
time: "12:00"
timezone: Europe/Athens
2 changes: 2 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ jobs:
publish:
needs: deploy
runs-on: ubuntu-latest
if: github.repository == 'twbs/icons'

steps:
- name: Clone repository
uses: actions/checkout@v3
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@

# Editor folders
/.vscode/

# Release zip files
bootstrap-icons-*.zip
8 changes: 0 additions & 8 deletions .stylelintrc

This file was deleted.

15 changes: 15 additions & 0 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"extends": [
"stylelint-config-twbs-bootstrap"
],
"reportInvalidScopeDisables": true,
"reportNeedlessDisables": true,
"overrides": [
{
"files": "**/*.scss",
"rules": {
"scss/selector-no-union-class-name": true
}
}
]
}
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2019-2021 The Bootstrap Authors
Copyright (c) 2019-2023 The Bootstrap Authors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
27 changes: 15 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<br>
</p>

[![Bootstrap Icons preview](https://github.com/twbs/icons/blob/main/.github/preview.png)](https://icons.getbootstrap.com)
[![Bootstrap Icons preview](https://github.com/twbs/icons/blob/main/.github/preview.png)](https://icons.getbootstrap.com/)

## Install

Expand All @@ -36,7 +36,7 @@ For those [using Packagist](https://packagist.org/packages/twbs/bootstrap-icons)
composer require twbs/bootstrap-icons
```

[Also available in Figma.](https://www.figma.com/community/file/1042482994486402696/Bootstrap-Icons)
[Also available in Figma](https://www.figma.com/community/file/1042482994486402696/Bootstrap-Icons).

## Usage

Expand All @@ -47,11 +47,12 @@ Depending on your setup, you can include Bootstrap Icons in a handful of ways.
- Use the SVG sprite
- Include via CSS

[See the docs for more information.](https://icons.getbootstrap.com/#usage)
[See the docs for more information](https://icons.getbootstrap.com/#usage).

## Development

[![Build Status](https://github.com/twbs/icons/workflows/Tests/badge.svg)](https://github.com/twbs/icons/actions?workflow=Tests)
[![Build Status](https://img.shields.io/github/actions/workflow/status/twbs/icons/test.yml?branch=main&label=Tests&logo=github)](https://github.com/twbs/icons/actions/workflows/test.yml?query=workflow%3ATests+branch%3Amain)
[![npm version](https://img.shields.io/npm/v/bootstrap-icons?logo=npm&logoColor=fff)](https://www.npmjs.com/package/bootstrap-icons)

Clone the repo, install dependencies, and start the Hugo server locally.

Expand All @@ -66,24 +67,26 @@ Then open `http://localhost:4000` in your browser.

### npm scripts

Here are some key scripts you'll use during development. Be sure to look to our `package.json` for a complete list of scripts.
Here are some key scripts you'll use during development. Be sure to look to our `package.json` or `npm run` output for a complete list of scripts.

| Script | Description |
| --- | --- |
| `start` | Alias for running `docs-serve` |
| `docs-serve` | Starts a local Hugo server |
| `pages` | Generates permalink pages for each icon with template Markdown |
| `icons` | Processes and optimizes SVGs in `icons` directory |
| Script | Description |
|--------------|-------------------------------------------------------------------------------|
| `start` | Alias for running `docs-serve` |
| `docs-serve` | Starts a local Hugo server |
| `pages` | Generates permalink pages for each icon with template Markdown |
| `icons` | Processes and optimizes SVGs in `icons` directory, generates fonts and sprite |

## Adding SVGs

Icons are typically only added by @mdo, but exceptions can be made. New glyphs are designed in Figma first on a 16x16px grid, then exported as flattened SVGs with `fill` (no stroke). Once a new SVG icon has been added to the `icons` directory, we use an npm script to:

1. Optimize our SVGs with SVGO.
2. Modify the SVGs source HTML, removing all attributes before setting new attributes and values in our preferred order.
2. Modify the SVGs source code, removing all attributes before setting new attributes and values in our preferred order.

Use `npm run icons` to run the script, run `npm run pages` to build permalink pages, complete those pages, and, finally, commit the results in a new branch for updating.

**Warning**: Please exclude any auto-generated files, like `font/**` and `bootstrap-icons.svg` from your branch because they cause conflicts, and we generally update the dist files before a release.

## Publishing

Documentation is published automatically when a new Git tag is published. See our [GitHub Actions](https://github.com/twbs/icons/tree/main/.github/workflows) and [`package.json`](https://github.com/twbs/icons/blob/main/package.json) for more information.
Expand Down
6 changes: 3 additions & 3 deletions build/build-pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

'use strict'

const fs = require('fs').promises
const path = require('path')
const fs = require('node:fs').promises
const path = require('node:path')
const picocolors = require('picocolors')

const iconsDir = path.join(__dirname, '../icons/')
Expand Down Expand Up @@ -53,7 +53,7 @@ tags:

const filesLength = files.length

console.log(picocolors.green('\nSuccess, %s page%s prepared!'), filesLength, filesLength !== 1 ? 's' : '')
console.log(picocolors.green('\nSuccess, %s page%s prepared!'), filesLength, filesLength === 1 ? '' : 's')
console.timeEnd(timeLabel)
} catch (error) {
console.error(error)
Expand Down
8 changes: 4 additions & 4 deletions build/build-svgs.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

'use strict'

const fs = require('fs').promises
const path = require('path')
const process = require('process')
const fs = require('node:fs').promises
const path = require('node:path')
const process = require('node:process')
const picocolors = require('picocolors')
const { loadConfig, optimize } = require('svgo')

Expand Down Expand Up @@ -46,7 +46,7 @@ async function processFile(file, config) {

const filesLength = files.length

console.log(picocolors.green('\nSuccess, prepared %s icon%s!'), filesLength, filesLength !== 1 ? 's' : '')
console.log(picocolors.green('\nSuccess, prepared %s icon%s!'), filesLength, filesLength === 1 ? '' : 's')
console.timeEnd(timeLabel)
} catch (error) {
console.error(error)
Expand Down
12 changes: 9 additions & 3 deletions build/font/css.hbs
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
/*!
* Bootstrap Icons (https://icons.getbootstrap.com/)
* Copyright 2019-2023 The Bootstrap Authors
* Licensed under MIT (https://github.com/twbs/icons/blob/main/LICENSE.md)
*/

@font-face {
font-display: block;
font-family: "{{ name }}";
src: {{{ fontSrc }}};
}

.{{prefix}}::before,
[class^="{{prefix}}-"]::before,
[class*=" {{prefix}}-"]::before {
.{{ prefix }}::before,
[class^="{{ prefix }}-"]::before,
[class*=" {{ prefix }}-"]::before {
display: inline-block;
font-family: {{ name }} !important;
font-style: normal;
Expand Down
19 changes: 13 additions & 6 deletions build/font/scss.hbs
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
/*!
* Bootstrap Icons (https://icons.getbootstrap.com/)
* Copyright 2019-2023 The Bootstrap Authors
* Licensed under MIT (https://github.com/twbs/icons/blob/main/LICENSE.md)
*/

${{ name }}-font: "{{ name }}" !default;
${{ name }}-font-dir: "{{ fontsUrl }}" !default;
${{ name }}-font-file: #{${{ name }}-font-dir}/#{${{ name }}-font} !default;
${{ name }}-font-hash: "28df46889dced875dea48cfe64755198" !default;
${{ name }}-font-src: url("#{${{ name }}-font-file}.woff2?#{${{ name }}-font-hash}") format("woff2"), url("#{${{ name }}-font-file}.woff?#{${{ name }}-font-hash}") format("woff") !default;
${{ name }}-font-file: "#{${{ name }}-font-dir}/#{${{ name }}-font}" !default;
${{ name }}-font-hash: "24e3eb84d0bcaf83d77f904c78ac1f47" !default;
${{ name }}-font-src: url("#{${{ name }}-font-file}.woff2?#{${{ name }}-font-hash}") format("woff2"),
url("#{${{ name }}-font-file}.woff?#{${{ name }}-font-hash}") format("woff") !default;

@font-face {
font-display: block;
font-family: ${{ name }}-font;
src: ${{ name }}-font-src;
}

.{{prefix}}::before,
[class^="{{prefix}}-"]::before,
[class*=" {{prefix}}-"]::before {
.{{ prefix }}::before,
[class^="{{ prefix }}-"]::before,
[class*=" {{ prefix }}-"]::before {
display: inline-block;
font-family: ${{ name }}-font !important;
font-style: normal;
Expand Down
12 changes: 8 additions & 4 deletions build/vnu-jar.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,24 @@

/*!
* Script to run vnu-jar if Java is available.
* Copyright 2017-2022 The Bootstrap Authors
* Copyright 2017-2022 Twitter, Inc.
* Copyright 2017-2023 The Bootstrap Authors
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/

'use strict'

const { execFile, spawn } = require('child_process')
const { execFile, spawn } = require('node:child_process')
const vnu = require('vnu-jar')

execFile('java', ['-version'], (error, stdout, stderr) => {
if (error) {
console.error('Skipping vnu-jar test; Java is missing.')
console.error('Skipping vnu-jar test; Java is probably missing.')
console.error(error)
return
}

console.log('Running vnu-jar validation...')

const is32bitJava = !/64-Bit/.test(stderr)

// vnu-jar accepts multiple ignores joined with a `|`.
Expand All @@ -40,6 +42,8 @@ execFile('java', ['-version'], (error, stdout, stderr) => {
args.splice(0, 0, '-Xss512k')
}

console.log(`command used: java ${args.join(' ')}`)

return spawn('java', args, {
shell: true,
stdio: 'inherit'
Expand Down
21 changes: 14 additions & 7 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,21 +46,28 @@ module:
target: static/assets/font
- source: node_modules/bootstrap/scss
target: assets/scss/bootstrap
- source: node_modules/bootstrap/dist/js/bootstrap.min.js
target: assets/js/bootstrap.min.js
- source: node_modules/bootstrap/dist/js/bootstrap.bundle.min.js
target: assets/js/vendor/bootstrap.bundle.min.js
- source: node_modules/clipboard/dist/clipboard.min.js
target: assets/js/vendor/clipboard.min.js
- source: node_modules/list.js/dist/list.min.js
target: assets/js/vendor/list.min.js

params:
description: "Official open source SVG icon library for Bootstrap"
social_image_path: /assets/img/bootstrap-icons-social.png

version: "1.10.2"
docs_version: "5.2"
version: "1.10.3"
docs_version: "5.3"

main: "https://getbootstrap.com"
github_org: "https://github.com/twbs"
repo: "https://github.com/twbs/icons"
icons_repo: "https://github.com/twbs/icons"
repo: "https://github.com/twbs/bootstrap"
twitter: "getbootstrap"
blog: "https://blog.getbootstrap.com"
themes: "https://themes.getbootstrap.com"
opencollective: "https://opencollective.com/bootstrap"
blog: "https://blog.getbootstrap.com/"
themes: "https://themes.getbootstrap.com/"
icons: "https://icons.getbootstrap.com/"
swag: "https://cottonbureau.com/people/bootstrap"
icons_figma: "https://www.figma.com/community/file/1042482994486402696/Bootstrap-Icons"
17 changes: 0 additions & 17 deletions docs/.eslintrc.json

This file was deleted.

Loading

0 comments on commit 06789f3

Please sign in to comment.