UNPKG

1.58 kBJavaScriptView Raw
1/*
2 * Copyright 2021 Palantir Technologies, Inc. All rights reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16// The two icon sets are identical aside from SVG paths, so we only need to import info for the 16px set
17import { BLUEPRINT_ICONS_16_CODEPOINTS } from "./generated-icons/16px/blueprint-icons-16";
18/**
19 * Icon codepoints as base 10 number strings. If you need to render these strings
20 * into an SVG document or as `::before` pseudo content, consider using `getIconContentString()`
21 * instead.
22 */
23export var IconCodepoints = BLUEPRINT_ICONS_16_CODEPOINTS;
24/**
25 * Returns the hex code content string which represents the codepoint in the icon font
26 * for a given icon. You can render this string to the DOM and if the icon font is loaded
27 * as an active font family, this string will be replaced with the associated icon.
28 */
29export function getIconContentString(icon) {
30 // parse base 10 number from string, then convert to hex code
31 return String.fromCodePoint(parseInt(IconCodepoints[icon], 10));
32}
33//# sourceMappingURL=iconCodepoints.js.map
\No newline at end of file