mirror of
https://github.com/ionic-team/ionicons.git
synced 2026-12-01 16:56:28 +01:00
feat(sanitize): opt-out of sanitizing http fetch svg content
This commit is contained in:
Vendored
+10
@@ -47,6 +47,11 @@ export namespace Components {
|
||||
* Specifies which icon to use from the built-in set of icons.
|
||||
*/
|
||||
"name"?: string;
|
||||
/**
|
||||
* When set to `false`, SVG content that is HTTP fetched will not be checked if the response SVG content has any `<script>` elements, or any attributes that start with `on`, such as `onclick`.
|
||||
* @default true
|
||||
*/
|
||||
"sanitize": boolean;
|
||||
/**
|
||||
* The size of the icon. Available options are: `"small"` and `"large"`.
|
||||
*/
|
||||
@@ -110,6 +115,11 @@ declare namespace LocalJSX {
|
||||
* Specifies which icon to use from the built-in set of icons.
|
||||
*/
|
||||
"name"?: string;
|
||||
/**
|
||||
* When set to `false`, SVG content that is HTTP fetched will not be checked if the response SVG content has any `<script>` elements, or any attributes that start with `on`, such as `onclick`.
|
||||
* @default true
|
||||
*/
|
||||
"sanitize"?: boolean;
|
||||
/**
|
||||
* The size of the icon. Available options are: `"small"` and `"large"`.
|
||||
*/
|
||||
|
||||
@@ -2,12 +2,11 @@ import { Build, Component, Element, Host, Prop, State, Watch, h } from '@stencil
|
||||
import { getSvgContent, ioniconContent } from './request';
|
||||
import { getName, getUrl } from './utils';
|
||||
|
||||
|
||||
@Component({
|
||||
tag: 'ion-icon',
|
||||
assetsDir: 'svg',
|
||||
styleUrl: 'icon.css',
|
||||
shadow: true
|
||||
shadow: true,
|
||||
})
|
||||
export class Icon {
|
||||
private io?: IntersectionObserver;
|
||||
@@ -35,7 +34,7 @@ export class Icon {
|
||||
/**
|
||||
* Set the icon to hidden, respectively `true`, to remove it from the accessibility tree.
|
||||
*/
|
||||
@Prop({reflect: true}) ariaHidden?: string;
|
||||
@Prop({ reflect: true }) ariaHidden?: string;
|
||||
|
||||
/**
|
||||
* Specifies which icon to use on `ios` mode.
|
||||
@@ -81,6 +80,14 @@ export class Icon {
|
||||
*/
|
||||
@Prop() lazy = false;
|
||||
|
||||
/**
|
||||
* When set to `false`, SVG content that is HTTP fetched will not be checked
|
||||
* if the response SVG content has any `<script>` elements, or any attributes
|
||||
* that start with `on`, such as `onclick`.
|
||||
* @default true
|
||||
*/
|
||||
@Prop() sanitize = true;
|
||||
|
||||
connectedCallback() {
|
||||
// purposely do not return the promise here because loading
|
||||
// the svg file should not hold up loading the app
|
||||
@@ -100,16 +107,18 @@ export class Icon {
|
||||
|
||||
private waitUntilVisible(el: HTMLElement, rootMargin: string, cb: () => void) {
|
||||
if (Build.isBrowser && this.lazy && typeof window !== 'undefined' && (window as any).IntersectionObserver) {
|
||||
const io = this.io = new (window as any).IntersectionObserver((data: IntersectionObserverEntry[]) => {
|
||||
if (data[0].isIntersecting) {
|
||||
io.disconnect();
|
||||
this.io = undefined;
|
||||
cb();
|
||||
}
|
||||
}, { rootMargin });
|
||||
const io = (this.io = new (window as any).IntersectionObserver(
|
||||
(data: IntersectionObserverEntry[]) => {
|
||||
if (data[0].isIntersecting) {
|
||||
io.disconnect();
|
||||
this.io = undefined;
|
||||
cb();
|
||||
}
|
||||
},
|
||||
{ rootMargin },
|
||||
));
|
||||
|
||||
io.observe(el);
|
||||
|
||||
} else {
|
||||
// browser doesn't support IntersectionObserver
|
||||
// so just fallback to always show it
|
||||
@@ -117,7 +126,6 @@ export class Icon {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Watch('name')
|
||||
@Watch('src')
|
||||
@Watch('icon')
|
||||
@@ -130,7 +138,7 @@ export class Icon {
|
||||
this.svgContent = ioniconContent.get(url);
|
||||
} else {
|
||||
// async if it hasn't been loaded
|
||||
getSvgContent(url).then(() => this.svgContent = ioniconContent.get(url));
|
||||
getSvgContent(url, this.sanitize).then(() => (this.svgContent = ioniconContent.get(url)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -147,31 +155,40 @@ export class Icon {
|
||||
|
||||
render() {
|
||||
const mode = this.mode || 'md';
|
||||
const flipRtl = this.flipRtl || (this.ariaLabel && (this.ariaLabel.indexOf('arrow') > -1 || this.ariaLabel.indexOf('chevron') > -1) && this.flipRtl !== false);
|
||||
const flipRtl =
|
||||
this.flipRtl ||
|
||||
(this.ariaLabel &&
|
||||
(this.ariaLabel.indexOf('arrow') > -1 || this.ariaLabel.indexOf('chevron') > -1) &&
|
||||
this.flipRtl !== false);
|
||||
|
||||
return (
|
||||
<Host role="img" class={{
|
||||
[mode]: true,
|
||||
...createColorClasses(this.color),
|
||||
[`icon-${this.size}`]: !!this.size,
|
||||
'flip-rtl': !!flipRtl && (this.el.ownerDocument as Document).dir === 'rtl'
|
||||
}}>{(
|
||||
(Build.isBrowser && this.svgContent)
|
||||
? <div class="icon-inner" innerHTML={this.svgContent}></div>
|
||||
: <div class="icon-inner"></div>
|
||||
<Host
|
||||
role="img"
|
||||
class={{
|
||||
[mode]: true,
|
||||
...createColorClasses(this.color),
|
||||
[`icon-${this.size}`]: !!this.size,
|
||||
'flip-rtl': !!flipRtl && (this.el.ownerDocument as Document).dir === 'rtl',
|
||||
}}
|
||||
>
|
||||
{Build.isBrowser && this.svgContent ? (
|
||||
<div class="icon-inner" innerHTML={this.svgContent}></div>
|
||||
) : (
|
||||
<div class="icon-inner"></div>
|
||||
)}
|
||||
</Host>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const getIonMode = () => (Build.isBrowser && typeof document !== 'undefined' && document.documentElement.getAttribute('mode')) || 'md';
|
||||
|
||||
const getIonMode = () =>
|
||||
(Build.isBrowser && typeof document !== 'undefined' && document.documentElement.getAttribute('mode')) || 'md';
|
||||
|
||||
const createColorClasses = (color: string | undefined) => {
|
||||
return (color) ? {
|
||||
'ion-color': true,
|
||||
[`ion-color-${color}`]: true
|
||||
} : null;
|
||||
return color
|
||||
? {
|
||||
'ion-color': true,
|
||||
[`ion-color-${color}`]: true,
|
||||
}
|
||||
: null;
|
||||
};
|
||||
|
||||
@@ -1,21 +1,22 @@
|
||||
import { validateContent } from './validate';
|
||||
|
||||
|
||||
export const ioniconContent = new Map<string, string>();
|
||||
const requests = new Map<string, Promise<any>>();
|
||||
|
||||
|
||||
export const getSvgContent = (url: string) => {
|
||||
export const getSvgContent = (url: string, sanitize: boolean) => {
|
||||
// see if we already have a request for this url
|
||||
let req = requests.get(url);
|
||||
|
||||
if (!req) {
|
||||
if (typeof fetch !== 'undefined') {
|
||||
if (typeof fetch !== 'undefined' && typeof document !== 'undefined') {
|
||||
// we don't already have a request
|
||||
req = fetch(url).then(rsp => {
|
||||
req = fetch(url).then((rsp) => {
|
||||
if (rsp.ok) {
|
||||
return rsp.text().then(svgContent => {
|
||||
ioniconContent.set(url, validateContent(svgContent));
|
||||
return rsp.text().then((svgContent) => {
|
||||
if (svgContent && sanitize !== false) {
|
||||
svgContent = validateContent(svgContent);
|
||||
}
|
||||
ioniconContent.set(url, svgContent || '');
|
||||
});
|
||||
}
|
||||
ioniconContent.set(url, '');
|
||||
|
||||
@@ -1,36 +1,32 @@
|
||||
import { isStr } from './utils';
|
||||
|
||||
export const validateContent = (svgContent: string) => {
|
||||
const div = document.createElement('div');
|
||||
div.innerHTML = svgContent;
|
||||
|
||||
export const validateContent = (svgContent: string | null) => {
|
||||
if (svgContent && typeof document !== 'undefined') {
|
||||
const div = document.createElement('div');
|
||||
div.innerHTML = svgContent;
|
||||
|
||||
// setup this way to ensure it works on our buddy IE
|
||||
for (let i = div.childNodes.length - 1; i >= 0; i--) {
|
||||
if (div.childNodes[i].nodeName.toLowerCase() !== 'svg') {
|
||||
div.removeChild(div.childNodes[i]);
|
||||
}
|
||||
// setup this way to ensure it works on our buddy IE
|
||||
for (let i = div.childNodes.length - 1; i >= 0; i--) {
|
||||
if (div.childNodes[i].nodeName.toLowerCase() !== 'svg') {
|
||||
div.removeChild(div.childNodes[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// must only have 1 root element
|
||||
const svgElm = div.firstElementChild;
|
||||
if (svgElm && svgElm.nodeName.toLowerCase() === 'svg') {
|
||||
const svgClass = svgElm.getAttribute('class') || '';
|
||||
svgElm.setAttribute('class', (svgClass + ' s-ion-icon').trim());
|
||||
// must only have 1 root element
|
||||
const svgElm = div.firstElementChild;
|
||||
if (svgElm && svgElm.nodeName.toLowerCase() === 'svg') {
|
||||
const svgClass = svgElm.getAttribute('class') || '';
|
||||
svgElm.setAttribute('class', (svgClass + ' s-ion-icon').trim());
|
||||
|
||||
// root element must be an svg
|
||||
// lets double check we've got valid elements
|
||||
// do not allow scripts
|
||||
if (isValid(svgElm as any)) {
|
||||
return div.innerHTML;
|
||||
}
|
||||
// root element must be an svg
|
||||
// lets double check we've got valid elements
|
||||
// do not allow scripts
|
||||
if (isValid(svgElm as any)) {
|
||||
return div.innerHTML;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
};
|
||||
|
||||
|
||||
export const isValid = (elm: HTMLElement) => {
|
||||
if (elm.nodeType === 1) {
|
||||
if (elm.nodeName.toLowerCase() === 'script') {
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><script>alert('got ya')</script><path d="M0 0h24v24H0z" fill="none"/><path d="M20 8h-2.81c-.45-.78-1.07-1.45-1.82-1.96L17 4.41 15.59 3l-2.17 2.17C12.96 5.06 12.49 5 12 5c-.49 0-.96.06-1.41.17L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8zm-6 8h-4v-2h4v2zm0-4h-4v-2h4v2z"/></svg>
|
||||
|
After Width: | Height: | Size: 544 B |
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><script>alert('got ya')</script><path d="M0 0h24v24H0z" fill="none"/><path d="M20 8h-2.81c-.45-.78-1.07-1.45-1.82-1.96L17 4.41 15.59 3l-2.17 2.17C12.96 5.06 12.49 5 12 5c-.49 0-.96.06-1.41.17L8.41 3 7 4.41l1.62 1.63C7.88 6.55 7.26 7.22 6.81 8H4v2h2.09c-.05.33-.09.66-.09 1v1H4v2h2v1c0 .34.04.67.09 1H4v2h2.81c1.04 1.79 2.97 3 5.19 3s4.15-1.21 5.19-3H20v-2h-2.09c.05-.33.09-.66.09-1v-1h2v-2h-2v-1c0-.34-.04-.67-.09-1H20V8zm-6 8h-4v-2h4v2zm0-4h-4v-2h4v2z"/></svg>
|
||||
|
After Width: | Height: | Size: 544 B |
+133
-129
@@ -1,157 +1,161 @@
|
||||
<!DOCTYPE html>
|
||||
<html dir="ltr" lang="en" mode="ios">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0" />
|
||||
<title>Ionicons Icon Component</title>
|
||||
<script type="module" src="/build/ionicons.esm.js"></script>
|
||||
<script nomodule src="/build/ionicons.js"></script>
|
||||
</head>
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0">
|
||||
<title>Ionicons Icon Component</title>
|
||||
<script type="module" src="/build/ionicons.esm.js"></script>
|
||||
<script nomodule src="/build/ionicons.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Ionicons</h1>
|
||||
|
||||
<body>
|
||||
<h2>Default</h2>
|
||||
<ion-icon name="cellular"></ion-icon>
|
||||
<ion-icon name="at"></ion-icon>
|
||||
<ion-icon name="call"></ion-icon>
|
||||
<ion-icon name="football"></ion-icon>
|
||||
<ion-icon name="analytics"></ion-icon>
|
||||
<ion-icon name="grid"></ion-icon>
|
||||
<ion-icon name="funnel"></ion-icon>
|
||||
<ion-icon name="watch"></ion-icon>
|
||||
<ion-icon name="add-circle-outline"></ion-icon>
|
||||
|
||||
<h1>Ionicons</h1>
|
||||
<h2>Mode from html ios mode attribute</h2>
|
||||
<ion-icon md="logo-android" ios="logo-apple"></ion-icon>
|
||||
<ion-icon md="logo-android" ios="logo-apple"></ion-icon>
|
||||
|
||||
<h2>Default</h2>
|
||||
<ion-icon name="cellular"></ion-icon>
|
||||
<ion-icon name="at"></ion-icon>
|
||||
<ion-icon name="call"></ion-icon>
|
||||
<ion-icon name="football"></ion-icon>
|
||||
<ion-icon name="analytics"></ion-icon>
|
||||
<ion-icon name="grid"></ion-icon>
|
||||
<ion-icon name="funnel"></ion-icon>
|
||||
<ion-icon name="watch"></ion-icon>
|
||||
<ion-icon name="add-circle-outline"></ion-icon>
|
||||
<h2>Mode set on icon</h2>
|
||||
<ion-icon mode="ios" md="logo-android" ios="logo-apple"></ion-icon>
|
||||
<ion-icon mode="md" md="logo-android" ios="logo-apple"></ion-icon>
|
||||
|
||||
<h2>Mode from html ios mode attribute</h2>
|
||||
<ion-icon md="logo-android" ios="logo-apple"></ion-icon>
|
||||
<ion-icon md="logo-android" ios="logo-apple"></ion-icon>
|
||||
<h2>Colors</h2>
|
||||
<ion-icon color="primary" name="cellular"></ion-icon>
|
||||
<ion-icon color="secondary" name="at"></ion-icon>
|
||||
<ion-icon color="tertiary" name="call"></ion-icon>
|
||||
<ion-icon color="success" name="football"></ion-icon>
|
||||
<ion-icon color="warning" name="analytics"></ion-icon>
|
||||
<ion-icon color="danger" name="grid"></ion-icon>
|
||||
<ion-icon color="light" name="funnel"></ion-icon>
|
||||
<ion-icon color="medium" name="watch"></ion-icon>
|
||||
<ion-icon color="dark" name="toggle"></ion-icon>
|
||||
|
||||
<h2>Mode set on icon</h2>
|
||||
<ion-icon mode="ios" md="logo-android" ios="logo-apple"></ion-icon>
|
||||
<ion-icon mode="md" md="logo-android" ios="logo-apple"></ion-icon>
|
||||
<h2>Stroke width</h2>
|
||||
<ion-icon name="heart-outline" style="--ionicon-stroke-width: 8px"></ion-icon>
|
||||
|
||||
<h2>Colors</h2>
|
||||
<ion-icon color="primary" name="cellular"></ion-icon>
|
||||
<ion-icon color="secondary" name="at"></ion-icon>
|
||||
<ion-icon color="tertiary" name="call"></ion-icon>
|
||||
<ion-icon color="success" name="football"></ion-icon>
|
||||
<ion-icon color="warning" name="analytics"></ion-icon>
|
||||
<ion-icon color="danger" name="grid"></ion-icon>
|
||||
<ion-icon color="light" name="funnel"></ion-icon>
|
||||
<ion-icon color="medium" name="watch"></ion-icon>
|
||||
<ion-icon color="dark" name="toggle"></ion-icon>
|
||||
<h2>Font size</h2>
|
||||
<ion-icon name="book" style="font-size: 50px"></ion-icon>
|
||||
<ion-icon src="./assets/bug_report.svg" style="font-size: 50px"></ion-icon>
|
||||
|
||||
<h2>Stroke width</h2>
|
||||
<ion-icon name="heart-outline" style="--ionicon-stroke-width: 8px;"></ion-icon>
|
||||
<h2>Custom SVGs</h2>
|
||||
<ion-icon src="./assets/bug_report.svg"></ion-icon>
|
||||
<ion-icon src="./assets/chat.svg"></ion-icon>
|
||||
<ion-icon src="./assets/commute.svg"></ion-icon>
|
||||
<ion-icon src="./assets/copyright.svg"></ion-icon>
|
||||
<ion-icon src="./assets/done_all.svg"></ion-icon>
|
||||
<ion-icon src="./assets/lock_open.svg"></ion-icon>
|
||||
<ion-icon src="./assets/toll.svg"></ion-icon>
|
||||
<ion-icon src="./assets/web_asset.svg"></ion-icon>
|
||||
<ion-icon src="./assets/work_outline.svg"></ion-icon>
|
||||
|
||||
<h2>Font size</h2>
|
||||
<ion-icon name="book" style="font-size: 50px;"></ion-icon>
|
||||
<ion-icon src="./assets/bug_report.svg" style="font-size: 50px;"></ion-icon>
|
||||
<h2>Custom SVGs: colors</h2>
|
||||
<ion-icon color="primary" src="./assets/bug_report.svg"></ion-icon>
|
||||
<ion-icon color="secondary" src="./assets/chat.svg"></ion-icon>
|
||||
<ion-icon color="tertiary" src="./assets/commute.svg"></ion-icon>
|
||||
<ion-icon color="success" src="./assets/copyright.svg"></ion-icon>
|
||||
<ion-icon color="warning" src="./assets/done_all.svg"></ion-icon>
|
||||
<ion-icon color="danger" src="./assets/lock_open.svg"></ion-icon>
|
||||
<ion-icon color="light" src="./assets/toll.svg"></ion-icon>
|
||||
<ion-icon color="medium" src="./assets/web_asset.svg"></ion-icon>
|
||||
<ion-icon color="dark" src="./assets/work_outline.svg"></ion-icon>
|
||||
|
||||
<h2>Custom SVGs</h2>
|
||||
<ion-icon src="./assets/bug_report.svg"></ion-icon>
|
||||
<ion-icon src="./assets/chat.svg"></ion-icon>
|
||||
<ion-icon src="./assets/commute.svg"></ion-icon>
|
||||
<ion-icon src="./assets/copyright.svg"></ion-icon>
|
||||
<ion-icon src="./assets/done_all.svg"></ion-icon>
|
||||
<ion-icon src="./assets/lock_open.svg"></ion-icon>
|
||||
<ion-icon src="./assets/toll.svg"></ion-icon>
|
||||
<ion-icon src="./assets/web_asset.svg"></ion-icon>
|
||||
<ion-icon src="./assets/work_outline.svg"></ion-icon>
|
||||
<h2>Custom CSS</h2>
|
||||
<ion-icon class="custom" name="grid"></ion-icon>
|
||||
<ion-icon class="custom" name="funnel"></ion-icon>
|
||||
<ion-icon class="custom" name="watch"></ion-icon>
|
||||
<ion-icon class="custom" name="logo-react"></ion-icon>
|
||||
<ion-icon class="custom" name="logo-javascript"></ion-icon>
|
||||
<ion-icon class="custom" name="logo-angular"></ion-icon>
|
||||
<ion-icon class="custom" src="./assets/done_all.svg"></ion-icon>
|
||||
<ion-icon class="custom" src="./assets/web_asset.svg"></ion-icon>
|
||||
<ion-icon class="custom" src="./assets/work_outline.svg"></ion-icon>
|
||||
|
||||
<h2>Custom SVGs: colors</h2>
|
||||
<ion-icon color="primary" src="./assets/bug_report.svg"></ion-icon>
|
||||
<ion-icon color="secondary" src="./assets/chat.svg"></ion-icon>
|
||||
<ion-icon color="tertiary" src="./assets/commute.svg"></ion-icon>
|
||||
<ion-icon color="success" src="./assets/copyright.svg"></ion-icon>
|
||||
<ion-icon color="warning" src="./assets/done_all.svg"></ion-icon>
|
||||
<ion-icon color="danger" src="./assets/lock_open.svg"></ion-icon>
|
||||
<ion-icon color="light" src="./assets/toll.svg"></ion-icon>
|
||||
<ion-icon color="medium" src="./assets/web_asset.svg"></ion-icon>
|
||||
<ion-icon color="dark" src="./assets/work_outline.svg"></ion-icon>
|
||||
<h2>Aria</h2>
|
||||
<ion-icon name="cellular"></ion-icon>
|
||||
<ion-icon name="cellular" aria-label="Mobile data"></ion-icon>
|
||||
<ion-icon name="cellular" aria-hidden="true"></ion-icon>
|
||||
|
||||
<h2>Custom CSS</h2>
|
||||
<ion-icon class="custom" name="grid"></ion-icon>
|
||||
<ion-icon class="custom" name="funnel"></ion-icon>
|
||||
<ion-icon class="custom" name="watch"></ion-icon>
|
||||
<ion-icon class="custom" name="logo-react"></ion-icon>
|
||||
<ion-icon class="custom" name="logo-javascript"></ion-icon>
|
||||
<ion-icon class="custom" name="logo-angular"></ion-icon>
|
||||
<ion-icon class="custom" src="./assets/done_all.svg"></ion-icon>
|
||||
<ion-icon class="custom" src="./assets/web_asset.svg"></ion-icon>
|
||||
<ion-icon class="custom" src="./assets/work_outline.svg"></ion-icon>
|
||||
<h1>RTL</h1>
|
||||
|
||||
<h2>Aria</h2>
|
||||
<ion-icon name="cellular"></ion-icon>
|
||||
<ion-icon name="cellular" aria-label="Mobile data"></ion-icon>
|
||||
<ion-icon name="cellular" aria-hidden="true"></ion-icon>
|
||||
<h2>Default: Non-arrows</h2>
|
||||
<ion-icon name="cut"></ion-icon>
|
||||
<ion-icon name="call"></ion-icon>
|
||||
<ion-icon name="checkbox"></ion-icon>
|
||||
<ion-icon name="brush"></ion-icon>
|
||||
|
||||
<h1>RTL</h1>
|
||||
<h2>Flip: Non-arrows</h2>
|
||||
<ion-icon name="cut" flip-rtl></ion-icon>
|
||||
<ion-icon name="call" flip-rtl></ion-icon>
|
||||
<ion-icon name="checkbox" flip-rtl></ion-icon>
|
||||
<ion-icon name="brush" flip-rtl></ion-icon>
|
||||
|
||||
<h2>Default: Non-arrows</h2>
|
||||
<ion-icon name="cut"></ion-icon>
|
||||
<ion-icon name="call"></ion-icon>
|
||||
<ion-icon name="checkbox"></ion-icon>
|
||||
<ion-icon name="brush"></ion-icon>
|
||||
<h2>Auto Flip: arrows</h2>
|
||||
<ion-icon name="arrow-up"></ion-icon>
|
||||
<ion-icon name="arrow-forward"></ion-icon>
|
||||
<ion-icon name="arrow-down"></ion-icon>
|
||||
<ion-icon name="arrow-back"></ion-icon>
|
||||
|
||||
<h2>Flip: Non-arrows</h2>
|
||||
<ion-icon name="cut" flip-rtl></ion-icon>
|
||||
<ion-icon name="call" flip-rtl></ion-icon>
|
||||
<ion-icon name="checkbox" flip-rtl></ion-icon>
|
||||
<ion-icon name="brush" flip-rtl></ion-icon>
|
||||
<h2>Un-flip: arrows</h2>
|
||||
<ion-icon name="arrow-up" flip-rtl="false"></ion-icon>
|
||||
<ion-icon name="arrow-forward" flip-rtl="false"></ion-icon>
|
||||
<ion-icon name="arrow-down" flip-rtl="false"></ion-icon>
|
||||
<ion-icon name="arrow-back" flip-rtl="false"></ion-icon>
|
||||
|
||||
<h2>Auto Flip: arrows</h2>
|
||||
<ion-icon name="arrow-up"></ion-icon>
|
||||
<ion-icon name="arrow-forward"></ion-icon>
|
||||
<ion-icon name="arrow-down"></ion-icon>
|
||||
<ion-icon name="arrow-back"></ion-icon>
|
||||
<h2>Auto Flip: chevrons</h2>
|
||||
<ion-icon name="chevron-up"></ion-icon>
|
||||
<ion-icon name="chevron-forward"></ion-icon>
|
||||
<ion-icon name="chevron-down"></ion-icon>
|
||||
<ion-icon name="chevron-back"></ion-icon>
|
||||
|
||||
<h2>Un-flip: arrows</h2>
|
||||
<ion-icon name="arrow-up" flip-rtl="false"></ion-icon>
|
||||
<ion-icon name="arrow-forward" flip-rtl="false"></ion-icon>
|
||||
<ion-icon name="arrow-down" flip-rtl="false"></ion-icon>
|
||||
<ion-icon name="arrow-back" flip-rtl="false"></ion-icon>
|
||||
<h2>Un-flip: chevrons</h2>
|
||||
<ion-icon name="chevron-up" flip-rtl="false"></ion-icon>
|
||||
<ion-icon name="chevron-forward" flip-rtl="false"></ion-icon>
|
||||
<ion-icon name="chevron-down" flip-rtl="false"></ion-icon>
|
||||
<ion-icon name="chevron-back" flip-rtl="false"></ion-icon>
|
||||
|
||||
<h2>Auto Flip: chevrons</h2>
|
||||
<ion-icon name="chevron-up"></ion-icon>
|
||||
<ion-icon name="chevron-forward"></ion-icon>
|
||||
<ion-icon name="chevron-down"></ion-icon>
|
||||
<ion-icon name="chevron-back"></ion-icon>
|
||||
<h2>Sanitized (shouldn't show)</h2>
|
||||
<ion-icon src="./assets/sanitize.svg"></ion-icon>
|
||||
|
||||
<h2>Un-flip: chevrons</h2>
|
||||
<ion-icon name="chevron-up" flip-rtl="false"></ion-icon>
|
||||
<ion-icon name="chevron-forward" flip-rtl="false"></ion-icon>
|
||||
<ion-icon name="chevron-down" flip-rtl="false"></ion-icon>
|
||||
<ion-icon name="chevron-back" flip-rtl="false"></ion-icon>
|
||||
<h2>Not Sanitized (should show)</h2>
|
||||
<ion-icon sanitize="false" src="./assets/no-sanitize.svg"></ion-icon>
|
||||
|
||||
<p>
|
||||
<a href="./cheatsheet.html">Cheatsheet</a>
|
||||
</p>
|
||||
<p>
|
||||
<a href="./cheatsheet.html">Cheatsheet</a>
|
||||
</p>
|
||||
|
||||
<style>
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 16px;
|
||||
font-size: 32px;
|
||||
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
}
|
||||
<style>
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 16px;
|
||||
font-size: 32px;
|
||||
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin: 15px 0 5px;
|
||||
font-size: 25px;
|
||||
}
|
||||
h1 {
|
||||
margin: 15px 0 5px;
|
||||
font-size: 25px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
margin: 15px 0 5px;
|
||||
font-size: 18px;
|
||||
}
|
||||
h2 {
|
||||
margin: 15px 0 5px;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.custom {
|
||||
stroke: red;
|
||||
fill: blue;
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
.custom {
|
||||
stroke: red;
|
||||
fill: blue;
|
||||
}
|
||||
</style>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user