Skip to content

Commit 6b021cf

Browse files
committed
un-deprecate icon font
1 parent 30ab62a commit 6b021cf

File tree

4 files changed

+9
-22
lines changed

4 files changed

+9
-22
lines changed

packages/core/src/common/classes.ts

-7
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,7 @@ export const TREE_NODE_SELECTED = `${TREE_NODE}-selected`;
290290
export const TREE_ROOT = `${NS}-tree-root`;
291291

292292
export const ICON = `${NS}-icon`;
293-
/** @deprecated use <Icon> components and iconName prop APIs instead */
294293
export const ICON_STANDARD = `${ICON}-standard`;
295-
/** @deprecated use <Icon> components and iconName prop APIs instead */
296294
export const ICON_LARGE = `${ICON}-large`;
297295

298296
/**
@@ -327,11 +325,6 @@ export function elevationClass(elevation: Elevation | undefined) {
327325

328326
/**
329327
* Returns CSS class for icon name.
330-
*
331-
* @deprecated These CSS classes rely on Blueprint's icon fonts, which are a legacy feature and will be
332-
* removed the next major version (4.x). Use the `<Icon>` React component and `iconName` string enum prop
333-
* APIs instead – they render SVGs, which do not suffer from the blurriness of icon fonts and have
334-
* equivalent browser support.
335328
*/
336329
export function iconClass(iconName: string): string;
337330
export function iconClass(iconName: undefined): undefined;

packages/core/src/components/icon/icon.md

+9-13
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,6 @@ See the [**Icons package**](#icons) for a searchable list of all available UI ic
66

77
</div>
88

9-
<div class="@ns-callout @ns-intent-primary @ns-icon-info-sign">
10-
<h4 class="@ns-heading">SVG icons in 2.0</h4>
11-
12-
Blueprint 2.0 introduced SVG icon support and moved icon resources to a separate __@blueprintjs/icons__ package.
13-
The `Icon` component renders SVG paths and the icon classes are no longer used by any Blueprint React component.
14-
Icon font support has been preserved but should be considered a legacy feature that will be removed in a
15-
future major version.
16-
17-
</div>
18-
199
This section describes two ways of using the UI icon font: via React `Icon`
2010
component to render SVG images or via CSS classes to use the icon font.
2111

@@ -55,12 +45,18 @@ import { IconNames } from "@blueprintjs/icons";
5545
<Icon icon="add" onClick={this.handleAdd} onKeyDown={this.handleAddKeys} />
5646
```
5747

58-
```html
48+
The following React component:
49+
50+
```tsx
5951
<Icon icon="globe" iconSize={30} />
60-
<!-- renders the following HTML markup: -->
52+
```
53+
54+
...renders this HTML markup:
55+
56+
```html
6157
<svg class="@ns-icon" data-icon="globe" width="30" height="30" viewBox="0 0 20 20">
6258
<title>globe</title>
63-
<path ... />
59+
<path d="..."></path>
6460
</svg>
6561
```
6662

packages/core/src/components/icon/icon.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ export class Icon extends AbstractPureComponent2<IIconProps & React.DOMAttribute
119119
// render path elements, or nothing if icon name is unknown.
120120
const paths = this.renderSvgPaths(pixelGridSize, icon);
121121

122-
// eslint-disable-next-line deprecation/deprecation
123122
const classes = classNames(Classes.ICON, Classes.iconClass(icon), Classes.intentClass(intent), className);
124123
const viewBox = `0 0 ${pixelGridSize} ${pixelGridSize}`;
125124

packages/core/test/icon/iconTests.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ describe("<Icon>", () => {
5555
});
5656

5757
it("prefixed icon renders blank icon", () => {
58-
// eslint-disable-next-line deprecation/deprecation
5958
assert.lengthOf(shallow(<Icon icon={Classes.iconClass("airplane") as any} />).find("path"), 0);
6059
});
6160

0 commit comments

Comments
 (0)