u2ui 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.htaccess +7 -0
- package/LICENSE +21 -0
- package/README.md +36 -0
- package/attr/behavior/README.md +25 -0
- package/attr/behavior/behavior.js +261 -0
- package/attr/behavior/manifest.json +43 -0
- package/attr/behavior/tests/minimal.html +19 -0
- package/attr/behavior/tests/test.html +98 -0
- package/attr/confirm/README.md +36 -0
- package/attr/confirm/confirm.js +90 -0
- package/attr/confirm/manifest.json +43 -0
- package/attr/confirm/tests/minimal.html +23 -0
- package/attr/confirm/tests/test.html +79 -0
- package/attr/draghandle/README.md +41 -0
- package/attr/draghandle/draghandle.js +42 -0
- package/attr/draghandle/tests/minimal.html +44 -0
- package/attr/focusgroup/README.md +49 -0
- package/attr/focusgroup/focusgroup.js +100 -0
- package/attr/focusgroup/manifest.json +38 -0
- package/attr/focusgroup/tests/minimal.html +27 -0
- package/attr/focusgroup/tests/test.html +154 -0
- package/attr/href/README.md +38 -0
- package/attr/href/href.js +42 -0
- package/attr/href/manifest.json +43 -0
- package/attr/href/tests/minimal.html +17 -0
- package/attr/href/tests/test.html +70 -0
- package/attr/intersect/README.md +42 -0
- package/attr/intersect/intersect.js +99 -0
- package/attr/intersect/manifest.json +57 -0
- package/attr/intersect/tests/minimal.html +30 -0
- package/attr/intersect/tests/test.html +64 -0
- package/attr/navigable/README.md +31 -0
- package/attr/navigable/TargetObserver.js +91 -0
- package/attr/navigable/U2TargetObserver.js +75 -0
- package/attr/navigable/manifest.json +42 -0
- package/attr/navigable/navigable.js +87 -0
- package/attr/navigable/tests/U1TargetObserver.html +56 -0
- package/attr/navigable/tests/minimal.html +17 -0
- package/attr/navigable/tests/targetObserver.html +106 -0
- package/attr/navigable/tests/test.html +84 -0
- package/attr/parallax/README.md +48 -0
- package/attr/parallax/parallax.js +119 -0
- package/attr/parallax/tests/minimal.html +25 -0
- package/attr/parallax/tests/performance.html +102 -0
- package/attr/parallax/tests/test.html +108 -0
- package/attr/skin/README.md +59 -0
- package/attr/skin/skin.css +51 -0
- package/attr/skin/tests/minimal.html +34 -0
- package/attr/skin/tests/test.html +96 -0
- package/class/badge/README.md +25 -0
- package/class/badge/badge.css +35 -0
- package/class/badge/tests/minimal.html +17 -0
- package/class/badge/tests/test.html +112 -0
- package/class/card1/README.md +45 -0
- package/class/card1/card1.css +30 -0
- package/class/card1/tests/minimal.html +33 -0
- package/class/card1/tests/test.html +78 -0
- package/class/flex/README.md +62 -0
- package/class/flex/flex.css +25 -0
- package/class/flex/tests/minimal.html +31 -0
- package/class/flex/tests/test.html +58 -0
- package/class/grid/README.md +52 -0
- package/class/grid/grid.css +40 -0
- package/class/grid/tests/minimal.html +34 -0
- package/class/grid/tests/test.html +78 -0
- package/class/input/README.md +49 -0
- package/class/input/input.css +33 -0
- package/class/input/tests/minimal.html +39 -0
- package/class/input/tests/test.html +29 -0
- package/class/reset/README.md +47 -0
- package/class/reset/reset.css +8 -0
- package/class/reset/tests/minimal.html +23 -0
- package/class/table/README.md +57 -0
- package/class/table/table.css +126 -0
- package/class/table/tests/minimal.html +40 -0
- package/class/table/tests/test.html +226 -0
- package/class/unstyle/README.md +32 -0
- package/class/unstyle/tests/minimal.html +22 -0
- package/class/unstyle/tests/test.html +32 -0
- package/class/unstyle/unstyle.css +12 -0
- package/class/width/README.md +48 -0
- package/class/width/tests/minimal.html +27 -0
- package/class/width/tests/test.html +101 -0
- package/class/width/width.css +22 -0
- package/css/base/README.md +25 -0
- package/css/base/base.css +127 -0
- package/css/base/beta.css +50 -0
- package/css/base/full.css +5 -0
- package/css/base/nomotion.css +9 -0
- package/css/base/print.css +36 -0
- package/css/base/tests/nomotion.html +89 -0
- package/css/base/tests/test.html +539 -0
- package/css/classes/README.md +17 -0
- package/css/classes/classes.css +78 -0
- package/css/classes/tests/test.html +63 -0
- package/css/classless/README.md +26 -0
- package/css/classless/aria.css +64 -0
- package/css/classless/classless.css +124 -0
- package/css/classless/full.css +11 -0
- package/css/classless/more.css +340 -0
- package/css/classless/simple.css +103 -0
- package/css/classless/snippeds/a/icons.css +12 -0
- package/css/classless/snippeds/experiments/conventions.css +41 -0
- package/css/classless/snippeds/hr/gradient.css +3 -0
- package/css/classless/snippeds/hr/section_sign.css +16 -0
- package/css/classless/snippeds/hr/tests.html +50 -0
- package/css/classless/tests/aria.html +101 -0
- package/css/classless/tests/foreign/classless-almond.css.html +445 -0
- package/css/classless/tests/foreign/classless-classless.css.html +831 -0
- package/css/classless/tests/foreign/classless-mvp.html +415 -0
- package/css/classless/tests/foreign/classless.sakura.html +224 -0
- package/css/classless/tests/foreign/stylestage.dev.html +304 -0
- package/css/classless/tests/foreign/test-homogenizer.html +433 -0
- package/css/classless/tests/foreign/test-html5-elements-tester.html +956 -0
- package/css/classless/tests/foreign/test-opinionated_css.html +148 -0
- package/css/classless/tests/list-bullet.html +110 -0
- package/css/classless/tests/more.html +246 -0
- package/css/classless/tests/oklch.experiments.html +280 -0
- package/css/classless/tests/test.html +106 -0
- package/css/classless/tests/variables.html +109 -0
- package/css/classless/variables.css +99 -0
- package/css/norm/README.md +37 -0
- package/css/norm/beta.css +40 -0
- package/css/norm/norm.css +98 -0
- package/css/norm/oldies.css +60 -0
- package/css/norm/tests/test.html +434 -0
- package/css/norm/tests/test.js +103 -0
- package/el/accordion/README.md +59 -0
- package/el/accordion/accordion.css +7 -0
- package/el/accordion/accordion.js +258 -0
- package/el/accordion/manifest.json +57 -0
- package/el/accordion/tests/minimal.html +44 -0
- package/el/accordion/tests/test.html +168 -0
- package/el/alert/README.md +67 -0
- package/el/alert/alert copy.js +224 -0
- package/el/alert/alert.css +73 -0
- package/el/alert/alert.js +187 -0
- package/el/alert/manifest.json +77 -0
- package/el/alert/tests/minimal.html +36 -0
- package/el/alert/tests/test.html +105 -0
- package/el/buttongroup/README.md +36 -0
- package/el/buttongroup/buttongroup.css +30 -0
- package/el/buttongroup/buttongroup.js +56 -0
- package/el/buttongroup/tests/minimal.html +31 -0
- package/el/buttongroup/tests/test.html +83 -0
- package/el/bytes/README.md +41 -0
- package/el/bytes/bytes.css +6 -0
- package/el/bytes/bytes.js +97 -0
- package/el/bytes/manifest.json +95 -0
- package/el/bytes/tests/minimal.html +19 -0
- package/el/bytes/tests/test.html +117 -0
- package/el/carousel/README.md +52 -0
- package/el/carousel/carousel.css +46 -0
- package/el/carousel/carousel.js +371 -0
- package/el/carousel/manifest.json +58 -0
- package/el/carousel/tests/experiments.html +77 -0
- package/el/carousel/tests/minimal.html +31 -0
- package/el/carousel/tests/nested.html +54 -0
- package/el/carousel/tests/test.html +136 -0
- package/el/carousel-nav/README.md +40 -0
- package/el/carousel-nav/carousel-nav.js +74 -0
- package/el/carousel-nav/tests/minimal.html +32 -0
- package/el/carousel-nav/tests/test.html +59 -0
- package/el/code/README.md +68 -0
- package/el/code/code.css +46 -0
- package/el/code/code.js +289 -0
- package/el/code/manifest.json +66 -0
- package/el/code/tests/minimal.html +35 -0
- package/el/code/tests/test.html +162 -0
- package/el/copy/README.md +35 -0
- package/el/copy/copy.css +3 -0
- package/el/copy/copy.js +118 -0
- package/el/copy/manifest.json +49 -0
- package/el/copy/tests/minimal.html +21 -0
- package/el/copy/tests/test.html +75 -0
- package/el/counter/README.md +47 -0
- package/el/counter/counter.css +8 -0
- package/el/counter/counter.js +95 -0
- package/el/counter/manifest.json +59 -0
- package/el/counter/tests/minimal.html +27 -0
- package/el/counter/tests/test.html +106 -0
- package/el/ico/README.md +162 -0
- package/el/ico/font/Font Awesome.css +22 -0
- package/el/ico/font/LigatureSymbols.css +7 -0
- package/el/ico/font/Material Icons.css +6 -0
- package/el/ico/font/RemixFilled.css +8 -0
- package/el/ico/font/RemixOutlined.css +8 -0
- package/el/ico/font/old/anicons.css +31 -0
- package/el/ico/font/old/devicons.css +210 -0
- package/el/ico/font/old/material.all.css +36 -0
- package/el/ico/font/old/remix.css +15 -0
- package/el/ico/font/old/utf8.css +54 -0
- package/el/ico/ico.css +111 -0
- package/el/ico/ico.js +189 -0
- package/el/ico/manifest.json +86 -0
- package/el/ico/tests/combinations.html +86 -0
- package/el/ico/tests/emojis.html +213 -0
- package/el/ico/tests/fonts.html +110 -0
- package/el/ico/tests/ico-directory.html +254 -0
- package/el/ico/tests/minimal.html +46 -0
- package/el/ico/tests/test.html +210 -0
- package/el/ico/tests/util-multi.svg +6 -0
- package/el/ico/tests/util.css +2 -0
- package/el/ico/tests/util.js +110 -0
- package/el/input/README.md +39 -0
- package/el/input/input.css +35 -0
- package/el/input/input.js +331 -0
- package/el/input/tests/formParticipation.html +113 -0
- package/el/input/tests/minimal.html +33 -0
- package/el/input/tests/test.html +258 -0
- package/el/masonry/README.md +51 -0
- package/el/masonry/manifest.json +60 -0
- package/el/masonry/masonry.css +27 -0
- package/el/masonry/masonry.js +92 -0
- package/el/masonry/tests/minimal.html +39 -0
- package/el/masonry/tests/test.html +42 -0
- package/el/number/README.md +47 -0
- package/el/number/manifest.json +121 -0
- package/el/number/number.css +6 -0
- package/el/number/number.js +67 -0
- package/el/number/tests/minimal.html +25 -0
- package/el/number/tests/test.html +138 -0
- package/el/out/README.md +32 -0
- package/el/out/manifest.json +38 -0
- package/el/out/out.css +2 -0
- package/el/out/out.js +59 -0
- package/el/out/tests/minimal.html +25 -0
- package/el/out/tests/test.html +37 -0
- package/el/parallax-bg/README.md +36 -0
- package/el/parallax-bg/parallax-bg.css +13 -0
- package/el/parallax-bg/parallax-bg.js +186 -0
- package/el/parallax-bg/tests/bg.jpg +0 -0
- package/el/parallax-bg/tests/bg1.jpg +0 -0
- package/el/parallax-bg/tests/bg2.jpg +0 -0
- package/el/parallax-bg/tests/demo.html +88 -0
- package/el/parallax-bg/tests/minimal.html +30 -0
- package/el/parallax-bg/tests/test.html +64 -0
- package/el/parallax-bg/tests/visible.html +90 -0
- package/el/qrcode/README.md +38 -0
- package/el/qrcode/manifest.json +43 -0
- package/el/qrcode/package.json +22 -0
- package/el/qrcode/qrcode.css +13 -0
- package/el/qrcode/qrcode.js +46 -0
- package/el/qrcode/tests/minimal.html +26 -0
- package/el/qrcode/tests/test.html +31 -0
- package/el/rating/README.md +45 -0
- package/el/rating/manifest.json +65 -0
- package/el/rating/rating.css +11 -0
- package/el/rating/rating.js +139 -0
- package/el/rating/tests/minimal.html +26 -0
- package/el/rating/tests/tests.html +77 -0
- package/el/rte/README.md +37 -0
- package/el/rte/rte.css +9 -0
- package/el/rte/rte.js +56 -0
- package/el/rte/tests/minimal.html +25 -0
- package/el/rte/tests/test.html +37 -0
- package/el/skeleton/README.md +30 -0
- package/el/skeleton/manifest.json +51 -0
- package/el/skeleton/skeleton.css +61 -0
- package/el/skeleton/skeleton.js +72 -0
- package/el/skeleton/tests/minimal.html +22 -0
- package/el/skeleton/tests/test.html +22 -0
- package/el/splitbutton/README.md +39 -0
- package/el/splitbutton/splitbutton.css +48 -0
- package/el/splitbutton/splitbutton.js +26 -0
- package/el/splitbutton/tests/minimal.html +30 -0
- package/el/splitbutton/tests/test.html +68 -0
- package/el/splitpanel/README.md +39 -0
- package/el/splitpanel/manifest.json +49 -0
- package/el/splitpanel/splitpanel.css +17 -0
- package/el/splitpanel/splitpanel.js +116 -0
- package/el/splitpanel/tests/minimal.html +31 -0
- package/el/splitpanel/tests/tests.html +121 -0
- package/el/table/README.md +68 -0
- package/el/table/manifest.json +43 -0
- package/el/table/table.css +59 -0
- package/el/table/table.js +194 -0
- package/el/table/tests/minimal.html +38 -0
- package/el/table/tests/test.html +108 -0
- package/el/tabs/README.md +50 -0
- package/el/tabs/manifest.json +59 -0
- package/el/tabs/tabs.css +23 -0
- package/el/tabs/tabs.js +210 -0
- package/el/tabs/tests/minimal.html +35 -0
- package/el/tabs/tests/test.html +180 -0
- package/el/textfit/README.md +34 -0
- package/el/textfit/manifest.json +45 -0
- package/el/textfit/tests/minimal.html +25 -0
- package/el/textfit/tests/test.html +26 -0
- package/el/textfit/textfit.css +6 -0
- package/el/textfit/textfit.js +80 -0
- package/el/time/README.md +72 -0
- package/el/time/manifest.json +118 -0
- package/el/time/tests/minimal.html +19 -0
- package/el/time/tests/test.html +160 -0
- package/el/time/time copy.js +141 -0
- package/el/time/time.js +168 -0
- package/el/time/time.old.uhtml.js +129 -0
- package/el/tooltip/README.md +48 -0
- package/el/tooltip/manifest.json +69 -0
- package/el/tooltip/tests/minimal.html +25 -0
- package/el/tooltip/tests/test.html +178 -0
- package/el/tooltip/tooltip.css +97 -0
- package/el/tooltip/tooltip.js +82 -0
- package/el/tree1/README.md +111 -0
- package/el/tree1/manifest.json +78 -0
- package/el/tree1/tests/animated.html +134 -0
- package/el/tree1/tests/custom.html +51 -0
- package/el/tree1/tests/minimal.html +44 -0
- package/el/tree1/tests/test.html +260 -0
- package/el/tree1/tree1.css +26 -0
- package/el/tree1/tree1.js +265 -0
- package/el/typewriter/README.md +62 -0
- package/el/typewriter/manifest.json +66 -0
- package/el/typewriter/tests/minimal.html +25 -0
- package/el/typewriter/tests/test.html +78 -0
- package/el/typewriter/typewriter.css +6 -0
- package/el/typewriter/typewriter.js +166 -0
- package/el/typewriter/typewriter.mp3 +0 -0
- package/js/Placer/Placer.js +156 -0
- package/js/Placer/README.md +62 -0
- package/js/Placer/tests/minimal.html +34 -0
- package/js/Placer/tests/test.html +49 -0
- package/js/PointerObserver/PointerObserver.js +130 -0
- package/js/PointerObserver/README.md +34 -0
- package/js/PointerObserver/tests/minimal.html +29 -0
- package/js/PointerObserver/tests/test.html +35 -0
- package/js/SelectorObserver/README.md +47 -0
- package/js/SelectorObserver/SelectorObserver.js +201 -0
- package/js/SelectorObserver/tests/minimal.html +21 -0
- package/js/SelectorObserver/tests/test.html +57 -0
- package/js/SelectorObserver/tests/tests.html +161 -0
- package/js/contextmenu/README.md +93 -0
- package/js/contextmenu/contextmenu.js +336 -0
- package/js/contextmenu/tests/minimal.html +44 -0
- package/js/contextmenu/tests/test.html +131 -0
- package/js/dialog/README.md +49 -0
- package/js/dialog/dialog.js +261 -0
- package/js/dialog/notification.mp3 +0 -0
- package/js/dialog/tests/minimal.html +29 -0
- package/js/dialog/tests/notification.mp3 +0 -0
- package/js/dialog/tests/test.html +135 -0
- package/js/rte/README.md +44 -0
- package/js/rte/old/NodeCleaner.js +315 -0
- package/js/rte/old/Rte/Rte.mjs +316 -0
- package/js/rte/old/Rte/Rte.ui.items.mjs +543 -0
- package/js/rte/old/Rte/Rte.ui.mjs +154 -0
- package/js/rte/old/Rte/crossbrowser.mjs +323 -0
- package/js/rte/old/Rte/font/tinymce.svg +98 -0
- package/js/rte/old/Rte/font/tinymce.woff +0 -0
- package/js/rte/old/Rte/helpers.mjs +159 -0
- package/js/rte/old/Rte/htmlparser.mjs +178 -0
- package/js/rte/old/Rte/index.mjs +5 -0
- package/js/rte/old/Rte/main.css +189 -0
- package/js/rte/old/old.rte.js +132 -0
- package/js/rte/old/range-selection.old.js +394 -0
- package/js/rte/rte.js +7 -0
- package/js/rte/src/behavior.js +228 -0
- package/js/rte/src/events.js +73 -0
- package/js/rte/src/fixes.js +251 -0
- package/js/rte/src/range.js +472 -0
- package/js/rte/src/rte.js +72 -0
- package/js/rte/src/ui/items/ai.js +167 -0
- package/js/rte/src/ui/items/code.js +93 -0
- package/js/rte/src/ui/items/undo.js +183 -0
- package/js/rte/src/ui.items.js +571 -0
- package/js/rte/src/ui.js +269 -0
- package/js/rte/src/util/htmlparser.js +178 -0
- package/js/rte/src/util/indentHtml.js +48 -0
- package/js/rte/tests/ai.html +81 -0
- package/js/rte/tests/behavior.html +88 -0
- package/js/rte/tests/events.html +69 -0
- package/js/rte/tests/fixes.html +95 -0
- package/js/rte/tests/minimal.html +34 -0
- package/js/rte/tests/notes.md +6 -0
- package/js/rte/tests/range.html +167 -0
- package/js/rte/tests/selection-explorer.html +222 -0
- package/js/rte/tests/test.html +92 -0
- package/js/shortcut/README.md +33 -0
- package/js/shortcut/shortcut.js +89 -0
- package/js/shortcut/tests/minimal.html +23 -0
- package/js/shortcut/tests/test.html +68 -0
- package/package.json +12 -0
- package/u2/README.md +4 -0
- package/u2/auto.js +161 -0
- package/u2/auto.ui.js +85 -0
- package/u2/experiments/Waiter/test.html +132 -0
- package/u2/experiments/getElementByIdPromise/test.html +76 -0
- package/u2/experiments/patchInputValue.html +124 -0
- package/u2/experiments/radiobutton/test.html +75 -0
- package/u2/experiments/tests/test.html +223 -0
- package/u2/experiments/u1-responsive/responsive.js +62 -0
- package/u2/experiments/u1-responsive/test.html +65 -0
- package/u2/experiments/u2Element.js +139 -0
- package/u2/experiments/u2Element.test.html +47 -0
- package/u2/old-stuff/IterableWeakMap/mod.js +70 -0
- package/u2/old-stuff/css/onStyleSheet/mod.js +114 -0
- package/u2/old-stuff/css/onStyleSheet/monkeypatches.js +28 -0
- package/u2/old-stuff/css/onStyleSheet/test/include.css +19 -0
- package/u2/old-stuff/css/onStyleSheet/test/style-has-include.css +6 -0
- package/u2/old-stuff/css/onStyleSheet/test/style-no-include.css +3 -0
- package/u2/old-stuff/css/onStyleSheet/test/test.html +48 -0
- package/u2/old-stuff/css/parser/mod.js +182 -0
- package/u2/old-stuff/css/parser/parser_old/mod.js +128 -0
- package/u2/old-stuff/css/parser/parser_old/test.html +43 -0
- package/u2/old-stuff/css/parser/parser_old/util.js +22 -0
- package/u2/old-stuff/css/parser/style.html +52 -0
- package/u2/old-stuff/css/parser/test.html +38 -0
- package/u2/old-stuff/el/ai-texter/README.md +23 -0
- package/u2/old-stuff/el/ai-texter/ai-texter.css +12 -0
- package/u2/old-stuff/el/ai-texter/ai-texter.js +153 -0
- package/u2/old-stuff/el/ai-texter/tests/minimal.html +47 -0
- package/u2/old-stuff/el/ai-texter/tests/test.html +71 -0
- package/u2/old-stuff/init.js +38 -0
- package/u2/old-stuff/markHashLinks.js +51 -0
- package/u2/old-stuff/onElement/mod.js +73 -0
- package/u2/old-stuff/test-helpers/mod.js +36 -0
- package/u2/old-stuff/test-helpers/test.html +4 -0
- package/u2/old-stuff/tests/init.js.html +51 -0
- package/u2/old-stuff/viewport.js +64 -0
- package/u2/projects.json +468 -0
- package/u2/tests/boilerplate.html +46 -0
- package/u2/tests/kacheln.html +245 -0
- package/u2/tests/showcase.html +270 -0
- package/u2/tests/showcase2.html +157 -0
- package/u2/tests/test-init.js +35 -0
- package/u2/tests/test.html +355 -0
- package/u2/tools/baseElement.js +95 -0
- package/u2/tools/baseElement.test.html +119 -0
- package/u2/tools/ce-inspector.js +308 -0
- package/u2/tools/ce-inspector.test.html +66 -0
- package/u2/tools/ce-manfest-from-element.js +207 -0
- package/u2/tools/dev-iframe.js +213 -0
- package/u2/tools/dev-iframe.test.html +75 -0
- package/u2/tools/eventsExplorer.js +101 -0
- package/u2/tools/logo/u1.svg +9 -0
- package/u2/tools/logo/u1ui.svg +6 -0
- package/u2/tools/update.repos.json.js +234 -0
- package/u2/u2.js +14 -0
- package/u2/utils.js +59 -0
package/el/ico/ico.css
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
html {
|
|
2
|
+
--u2-ico-font:'Segoe UI Symbol', 'Noto Emoji', sans-serif; /* noto on linux? */
|
|
3
|
+
/* --u2-ico-dir:'https://cdn.jsdelivr.net/npm/@material-icons/svg@1.0.33/svg/{icon_name}/baseline.svg'; */
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
u2-ico {
|
|
7
|
+
font-weight: normal;
|
|
8
|
+
font-style: normal;
|
|
9
|
+
line-height: 1;
|
|
10
|
+
--line-height: 1;
|
|
11
|
+
text-transform: none;
|
|
12
|
+
letter-spacing: normal;
|
|
13
|
+
overflow-wrap: normal;
|
|
14
|
+
white-space: nowrap;
|
|
15
|
+
direction: ltr;
|
|
16
|
+
-webkit-font-smoothing: antialiased; /* all WebKit browsers. */
|
|
17
|
+
text-rendering: optimizeLegibility; /* Safari and Chrome. */
|
|
18
|
+
-moz-osx-font-smoothing: grayscale; /* Firefox. */
|
|
19
|
+
font-feature-settings: 'liga'; /* IE only? */
|
|
20
|
+
font-family: var(--u2-ico-font) !important;
|
|
21
|
+
|
|
22
|
+
fill:currentColor; /* for svg, dont use `u2-ico > svg { fill:currentColor }` because it can have the attribute fill="none" */
|
|
23
|
+
|
|
24
|
+
/* ok? */
|
|
25
|
+
xdisplay: inline-block; /* inline-flex has an other baseline? */
|
|
26
|
+
text-align:center;
|
|
27
|
+
vertical-align:middle;
|
|
28
|
+
--size: 1.5rem; /* 24px Preferred icon size, material-icons */
|
|
29
|
+
font-size: var(--size);
|
|
30
|
+
/* overflow:hidden
|
|
31
|
+
+ prevents layout-shift on font load.
|
|
32
|
+
- But baseline gets to the box instead of the text.
|
|
33
|
+
- Some Icons on some Fonts may get cuted!
|
|
34
|
+
*/
|
|
35
|
+
}
|
|
36
|
+
u2-ico:not([hidden]) { display: inline-block; }
|
|
37
|
+
u2-ico[icon]:empty:before { /* todo if supported: :where([icon]::before) { */
|
|
38
|
+
content:attr(icon);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
/* inline */
|
|
44
|
+
u2-ico[inline] {
|
|
45
|
+
overflow:visible;
|
|
46
|
+
--size:1.2em;
|
|
47
|
+
/*
|
|
48
|
+
best option?:
|
|
49
|
+
centering using font-relative units
|
|
50
|
+
1ex support: good
|
|
51
|
+
1cap support: only firefox
|
|
52
|
+
https://codepen.io/kizu/pen/dyeXPJP?editors=1100
|
|
53
|
+
*/
|
|
54
|
+
vertical-align: -11%;
|
|
55
|
+
/* display: contents; todo? */
|
|
56
|
+
/* margin:auto; todo: dont stretch if its a flex-item? */
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/* direct svg and js-loaded */
|
|
60
|
+
u2-ico > svg {
|
|
61
|
+
vertical-align:bottom;
|
|
62
|
+
height:1em;
|
|
63
|
+
width:auto;
|
|
64
|
+
min-width:1em;
|
|
65
|
+
overflow:visible;
|
|
66
|
+
margin:auto;
|
|
67
|
+
}
|
|
68
|
+
u2-ico path[fill]:not([fill=none]) { fill:currentColor; }
|
|
69
|
+
u2-ico path[stroke]:not([stroke=none]) { stroke: currentColor; }
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
/* dir-variant */
|
|
73
|
+
u2-ico[state] {
|
|
74
|
+
&::before {
|
|
75
|
+
display:none;
|
|
76
|
+
}
|
|
77
|
+
&[state="loading"] {
|
|
78
|
+
xvisibility:hidden;
|
|
79
|
+
overflow: clip;
|
|
80
|
+
width:1em;
|
|
81
|
+
}
|
|
82
|
+
&[state="fail"] {
|
|
83
|
+
font-size: 0.8em;
|
|
84
|
+
width: auto;
|
|
85
|
+
::before {
|
|
86
|
+
display:block;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
u2-ico:empty:not([icon])::before {
|
|
91
|
+
content: '⚠️';
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/*
|
|
95
|
+
u2-ico[state]:not([state=loaded]) {
|
|
96
|
+
overflow:clip;
|
|
97
|
+
width: 1em;
|
|
98
|
+
height: 1em;
|
|
99
|
+
}
|
|
100
|
+
u2-ico[state]:before {
|
|
101
|
+
display:none;
|
|
102
|
+
}
|
|
103
|
+
u2-ico[state=fail]:before {
|
|
104
|
+
display:block;
|
|
105
|
+
}
|
|
106
|
+
u2-ico[state="fail"]:is([state="fail"]) {
|
|
107
|
+
font-size: 0.8em;
|
|
108
|
+
overflow: visible;
|
|
109
|
+
width: auto;
|
|
110
|
+
}
|
|
111
|
+
*/
|
package/el/ico/ico.js
ADDED
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
// icons from directory
|
|
2
|
+
// [u2-ico] {
|
|
3
|
+
// --u2-ico-dir:'https://cdn.jsdelivr.net/npm/teenyicons@0.4.1/outline/x-{icon-name}.svg';
|
|
4
|
+
// }
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
const observeStyle = (
|
|
9
|
+
target,
|
|
10
|
+
property,
|
|
11
|
+
callback,
|
|
12
|
+
initialValue = ''
|
|
13
|
+
) => {
|
|
14
|
+
let frameId, value
|
|
15
|
+
const css = getComputedStyle(target)
|
|
16
|
+
const observer = () => {
|
|
17
|
+
frameId = requestAnimationFrame(observer)
|
|
18
|
+
value = css.getPropertyValue(property).trim()
|
|
19
|
+
if (value !== initialValue) {
|
|
20
|
+
callback(initialValue = value);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
observer()
|
|
24
|
+
return () => cancelAnimationFrame(frameId)
|
|
25
|
+
}
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
const uIco = class extends HTMLElement {
|
|
29
|
+
constructor() {
|
|
30
|
+
super();
|
|
31
|
+
}
|
|
32
|
+
connectedCallback() {
|
|
33
|
+
|
|
34
|
+
// observeStyle(this, '--u2-ico-dir', dir => {
|
|
35
|
+
// this._handleIcon();
|
|
36
|
+
// });
|
|
37
|
+
|
|
38
|
+
if (this.firstElementChild) return; // skip if not text-only
|
|
39
|
+
if (!this.hasAttribute('icon')) {
|
|
40
|
+
const inner = this.textContent.trim();
|
|
41
|
+
if (inner) {
|
|
42
|
+
this.setAttribute('icon', inner);
|
|
43
|
+
this.setAttribute('aria-label', inner);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
this._handleIcon();
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
static observedAttributes = ['icon'];
|
|
50
|
+
attributeChangedCallback(name, oldValue, newValue) {
|
|
51
|
+
if (oldValue === newValue) return;
|
|
52
|
+
if (name === 'icon') {
|
|
53
|
+
setTimeout(() => this._handleIcon(),20); // wait for css to be applied
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
_handleIcon() {
|
|
57
|
+
// fetch svg if --ui-ico-directory is set
|
|
58
|
+
let icoDir = getComputedStyle(this).getPropertyValue('--u2-ico-dir').trim();
|
|
59
|
+
if (icoDir && this.hasAttribute('icon')) {
|
|
60
|
+
const dir = icoDir.slice(1, -1);
|
|
61
|
+
const name = this.getAttribute('icon');
|
|
62
|
+
const path = dirTemplateToUrl(dir, name);
|
|
63
|
+
|
|
64
|
+
requestAnimationFrame(()=>{
|
|
65
|
+
this.setAttribute('state','loading')
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
const pathStr = path.toString();
|
|
69
|
+
if (this._lastLoading === pathStr) return; // prevent multiple requests
|
|
70
|
+
this._lastLoading = pathStr;
|
|
71
|
+
|
|
72
|
+
loadSvgString(path).then(svg=>{
|
|
73
|
+
// if (path.origin !== location.origin) {} todo: sanitize svg
|
|
74
|
+
|
|
75
|
+
svg = svg.replace(/<!--.*?-->/gs, ''); // remove comments
|
|
76
|
+
svg = svg.replace(/<!DOCTYPE.*?>/gs, ''); // remove doctype
|
|
77
|
+
svg = svg.replace(/<\?xml.*?\?>/gs, ''); // remove xml header
|
|
78
|
+
|
|
79
|
+
requestAnimationFrame(()=>{
|
|
80
|
+
this.innerHTML = svg; // requestAnimationFrame??
|
|
81
|
+
this.querySelectorAll('[id]').forEach(el=>el.removeAttribute('id')); // remove ids
|
|
82
|
+
const svgEl = this.firstElementChild;
|
|
83
|
+
svgEl.removeAttribute('xmlns');
|
|
84
|
+
svgEl.removeAttribute('xmlns:xlink');
|
|
85
|
+
svgEl.removeAttribute('version');
|
|
86
|
+
svgEl.setAttribute('aria-hidden', 'true');
|
|
87
|
+
this.setAttribute('state','loaded');
|
|
88
|
+
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
// // store to combine
|
|
92
|
+
// queueMicrotask(()=>{
|
|
93
|
+
// const store = localStorage.getItem('u2-ico-used');
|
|
94
|
+
// const icons = store ? JSON.parse(store) : {};
|
|
95
|
+
// icons[icoDir] ??= {};
|
|
96
|
+
// icons[icoDir][name] = this.innerHTML.trim();
|
|
97
|
+
// localStorage.setItem('u2-ico-used', JSON.stringify(icons));
|
|
98
|
+
// });
|
|
99
|
+
|
|
100
|
+
}).catch(err=>{
|
|
101
|
+
console.error(err, this);
|
|
102
|
+
this.setAttribute('state','fail');
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// //combine svgs
|
|
111
|
+
// setTimeout(function(){
|
|
112
|
+
// const store = localStorage.getItem('u2-ico-used');
|
|
113
|
+
// if (!store) return;
|
|
114
|
+
// const icons = JSON.parse(store);
|
|
115
|
+
// for (const [dir, names] of Object.entries(icons)) {
|
|
116
|
+
// console.log(`instead of loading from ${dir}, you can generate a local file with to following content and load it like /myFile.txt#{icon}:`);
|
|
117
|
+
// let content = '<svg><defs>\n\n';
|
|
118
|
+
// for (let [name, svg] of Object.entries(names)) {
|
|
119
|
+
// svg = svg.replace(/<svg /, `<svg id="${name}" `);
|
|
120
|
+
// content += `${svg}\n\n`;
|
|
121
|
+
// }
|
|
122
|
+
// content += '\n\n</defs></svg>';
|
|
123
|
+
// console.log(content);
|
|
124
|
+
// }
|
|
125
|
+
// },199)
|
|
126
|
+
|
|
127
|
+
function dirTemplateToUrl(dir, name) {
|
|
128
|
+
let [prefix, firstWord, between='', nextWord, suffix] = dir.split(/{(icon)([^n]*)?(name)?}/i);
|
|
129
|
+
if (!suffix) suffix = prefix.includes('#') ? '' : '.svg';
|
|
130
|
+
if (!nextWord) between = '-'; // if just: {icon}
|
|
131
|
+
|
|
132
|
+
// icon naming convertion
|
|
133
|
+
let fileName = name;
|
|
134
|
+
const upperFirst = firstWord?.[0] === 'I';
|
|
135
|
+
const upperWords = nextWord?.[0] === 'N';
|
|
136
|
+
if (upperFirst) fileName = fileName.replace(/^([a-z])/, g => g[0].toUpperCase()); // first upper
|
|
137
|
+
if (upperWords) fileName = fileName.replace(/-([a-z])/g, g => g[1].toUpperCase()); // camel-case
|
|
138
|
+
if (between !== '-') fileName = fileName.replace(/-/g, between);
|
|
139
|
+
|
|
140
|
+
return new URL(prefix + fileName + suffix, location.href);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
async function loadSvgString(url) {
|
|
144
|
+
const hash = url.hash.substring(1);
|
|
145
|
+
|
|
146
|
+
// internal element
|
|
147
|
+
if (url.origin === location.origin && url.pathname === location.pathname) { // svg on the same document
|
|
148
|
+
if (hash) {
|
|
149
|
+
const element = document.getElementById(hash);
|
|
150
|
+
if (element) {
|
|
151
|
+
return element.outerHTML;
|
|
152
|
+
} else {
|
|
153
|
+
throw new Error("Element with id " + hash + " not found in the document");
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const svg = await loadCached(url);
|
|
159
|
+
// temporary cache svg
|
|
160
|
+
|
|
161
|
+
// external element
|
|
162
|
+
if (hash) { // todo, cache the svgDoc?
|
|
163
|
+
const parser = new DOMParser();
|
|
164
|
+
const svgDoc = parser.parseFromString(svg, "image/svg+xml");
|
|
165
|
+
const element = svgDoc.getElementById(hash);
|
|
166
|
+
if (element) {
|
|
167
|
+
return element.outerHTML;
|
|
168
|
+
} else {
|
|
169
|
+
throw new Error("Element with id " + hash + " not found in the document");
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// external document
|
|
174
|
+
return svg;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
const cachedRequests = {};
|
|
178
|
+
|
|
179
|
+
async function loadCached(url) {
|
|
180
|
+
if (cachedRequests[url]) return cachedRequests[url];
|
|
181
|
+
cachedRequests[url] = fetch(url, {cache: "force-cache"}).then(res => {
|
|
182
|
+
if (!res.ok) throw new Error(`Failed to fetch icon ${url}: ${res.status} ${res.statusText}`);
|
|
183
|
+
return res.text();
|
|
184
|
+
});
|
|
185
|
+
return cachedRequests[url];
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
customElements.define('u2-ico', uIco);
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "1.0.0",
|
|
3
|
+
"readme": "README.md",
|
|
4
|
+
"modules": [
|
|
5
|
+
{
|
|
6
|
+
"kind": "javascript-module",
|
|
7
|
+
"path": "ico.js",
|
|
8
|
+
"declarations": [
|
|
9
|
+
{
|
|
10
|
+
"kind": "class",
|
|
11
|
+
"description": "A custom HTML element for displaying icons from any icon set, icon font, or SVG directory.",
|
|
12
|
+
"name": "u2-ico",
|
|
13
|
+
"members": [],
|
|
14
|
+
"events": [],
|
|
15
|
+
"attributes": [
|
|
16
|
+
{
|
|
17
|
+
"name": "icon",
|
|
18
|
+
"description": "The name of the icon to display.",
|
|
19
|
+
"u2Examples": ["home","star","check","close"]
|
|
20
|
+
},{
|
|
21
|
+
"name": "state",
|
|
22
|
+
"u2-type": ["loading", "loaded", "fail"],
|
|
23
|
+
"description": "Read only, the state of the icon (loading, loaded, fail), this is set by javascript."
|
|
24
|
+
},{
|
|
25
|
+
"name": "inline",
|
|
26
|
+
"u2-type": "boolean",
|
|
27
|
+
"description": "Size and baseline optimized for inline text."
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
"cssProperties": [
|
|
31
|
+
{
|
|
32
|
+
"name": "--u2-ico-dir",
|
|
33
|
+
"syntax": "<string>",
|
|
34
|
+
"description": "The directory where the SVG icons are located. If set, it overrides --u2-ico-font.",
|
|
35
|
+
"u2Examples": [
|
|
36
|
+
"'https://cdn.jsdelivr.net/npm/@material-icons/svg@1.0.11/svg/{icon_name}/baseline.svg'",
|
|
37
|
+
"'https://cdn.jsdelivr.net/npm/teenyicons@0.4.1/outline/'",
|
|
38
|
+
"'https://cdn.jsdelivr.net/npm/feather-icons@4.28.0/dist/icons/'",
|
|
39
|
+
"'https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/icons/'",
|
|
40
|
+
"'https://cdn.jsdelivr.net/npm/octicons@8.5.0/build/svg/'",
|
|
41
|
+
"'https://cdn.jsdelivr.net/npm/bytesize-icons@1.4.0/dist/icons/'",
|
|
42
|
+
"'https://cdn.jsdelivr.net/npm/ionicons@5.5.1/dist/svg/'",
|
|
43
|
+
"'https://cdn.jsdelivr.net/npm/tabler-icons@1.35.0/icons/'",
|
|
44
|
+
"'https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.15.3/svgs/regular/'"
|
|
45
|
+
]
|
|
46
|
+
},{
|
|
47
|
+
"name": "--u2-ico-font",
|
|
48
|
+
"syntax": "<string>",
|
|
49
|
+
"description": "The font used for the icons. The icon-font has to be declared in the CSS.",
|
|
50
|
+
"u2Examples": [
|
|
51
|
+
"Material Icons",
|
|
52
|
+
"Teeny Icons",
|
|
53
|
+
"Feather Icons"
|
|
54
|
+
]
|
|
55
|
+
},{
|
|
56
|
+
"name": "--size",
|
|
57
|
+
"syntax": "<length>",
|
|
58
|
+
"description": "The size of the icon.",
|
|
59
|
+
"u2Examples": ["1em","3em","24px"]
|
|
60
|
+
},{
|
|
61
|
+
"name": "color",
|
|
62
|
+
"syntax": "<color>",
|
|
63
|
+
"description": "The color of the icon.",
|
|
64
|
+
"u2Examples": ["red","rgba(0,0,0,0.5)","lightblue"]
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
"superclass": {
|
|
68
|
+
"name": "HTMLElement"
|
|
69
|
+
},
|
|
70
|
+
"tagName": "u2-ico",
|
|
71
|
+
"customElement": true
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
"exports": [
|
|
75
|
+
{
|
|
76
|
+
"kind": "custom-element-definition",
|
|
77
|
+
"name": "u2-ico",
|
|
78
|
+
"declaration": {
|
|
79
|
+
"name": "uIco",
|
|
80
|
+
"module": "ico.js"
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang=en>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width">
|
|
6
|
+
<title>u2-ico Test</title>
|
|
7
|
+
|
|
8
|
+
<script src="../../../u2/tests/test-init.js" type=module async></script>
|
|
9
|
+
<script src="../../../u2/auto.js" type=module async></script>
|
|
10
|
+
|
|
11
|
+
<link rel=stylesheet href="../../../css/classless/simple.css">
|
|
12
|
+
<link rel="stylesheet" href="../font/Material Icons.css">
|
|
13
|
+
|
|
14
|
+
<style>
|
|
15
|
+
body {
|
|
16
|
+
--u2-ico-font: 'Material Icons';
|
|
17
|
+
}
|
|
18
|
+
u2-ico[inline] {
|
|
19
|
+
vertical-align: -16%;
|
|
20
|
+
}
|
|
21
|
+
</style>
|
|
22
|
+
|
|
23
|
+
<body>
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
<section>
|
|
28
|
+
<h2>button</h2>
|
|
29
|
+
<div id=buttonDemo>
|
|
30
|
+
<button>
|
|
31
|
+
<u2-ico inline>home</u2-ico>
|
|
32
|
+
Start Icon
|
|
33
|
+
</button>
|
|
34
|
+
|
|
35
|
+
<button>
|
|
36
|
+
<u2-ico inline icon=home style="--u2-ico-dir:'https://cdn.jsdelivr.net/npm/@material-icons/svg@1.0.11/svg/{icon_name}/baseline.svg'"></u2-ico>
|
|
37
|
+
Start Icon
|
|
38
|
+
</button>
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
<button>Normal</button>
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
Icon only:
|
|
46
|
+
<button style="padding-inline:.4em">
|
|
47
|
+
<u2-ico inline>home</u2-ico>
|
|
48
|
+
</button>
|
|
49
|
+
u2-unstyle
|
|
50
|
+
<button class="u2-unstyle">
|
|
51
|
+
<u2-ico inline>home</u2-ico>
|
|
52
|
+
</button>
|
|
53
|
+
|
|
54
|
+
</div>
|
|
55
|
+
<u2-code element=buttonDemo trim editable> </u2-code>
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
<section id=badge>
|
|
59
|
+
<h2>.u1-badge</h2>
|
|
60
|
+
<div id=badgeDemo>
|
|
61
|
+
<u2-ico>home</u2-ico>
|
|
62
|
+
<sup class=u2-badge style="margin-left:-.7em; background-color: red;"></sup>
|
|
63
|
+
</div>
|
|
64
|
+
<u2-code element=badgeDemo trim editable> </u2-code>
|
|
65
|
+
|
|
66
|
+
</section>
|
|
67
|
+
|
|
68
|
+
<section>
|
|
69
|
+
<h2>.u1-tooltip</h2>
|
|
70
|
+
|
|
71
|
+
<div id="Tooltip">
|
|
72
|
+
<u2-ico>
|
|
73
|
+
home
|
|
74
|
+
<u2-tooltip style="font-family:system-ui, -apple-system, sans-serif">
|
|
75
|
+
Tooltip
|
|
76
|
+
</u2-tooltip>
|
|
77
|
+
</u2-ico>
|
|
78
|
+
</div>
|
|
79
|
+
|
|
80
|
+
<div>
|
|
81
|
+
<u2-code element=Tooltip trim editable> </u2-code>
|
|
82
|
+
</div>
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
</section>
|
|
86
|
+
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang=en>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset=utf-8>
|
|
5
|
+
<meta name="viewport" content="width=device-width">
|
|
6
|
+
|
|
7
|
+
<link rel=stylesheet href="../../../css/norm/norm.css">
|
|
8
|
+
<link rel=stylesheet href="../../../css/base/base.css">
|
|
9
|
+
<link rel=stylesheet href="../../../css/classless/variables.css">
|
|
10
|
+
<link rel=stylesheet href="../../../css/classless/classless.css">
|
|
11
|
+
<link rel=stylesheet href="../../../css/classless/simple.css">
|
|
12
|
+
<link rel=stylesheet href="../../../css/classless/more.css">
|
|
13
|
+
|
|
14
|
+
<link rel="stylesheet" href="../ico.css">
|
|
15
|
+
|
|
16
|
+
<link rel="stylesheet" href="./util.css">
|
|
17
|
+
<script type=module async src="../ico.js"></script>
|
|
18
|
+
<script type=module async src="./util.js"></script>
|
|
19
|
+
|
|
20
|
+
<body>
|
|
21
|
+
|
|
22
|
+
<style>
|
|
23
|
+
@font-face {
|
|
24
|
+
font-family: 'segoe local';
|
|
25
|
+
src: local('Segoe UI Symbol');
|
|
26
|
+
}
|
|
27
|
+
@font-face {
|
|
28
|
+
font-family: 'Font Awesome url';
|
|
29
|
+
font-style: normal;
|
|
30
|
+
font-weight: 400;
|
|
31
|
+
xsrc: url(https://cdn.jsdelivr.net/gh/FortAwesome/Font-Awesome/webfonts/fa-solid-900.woff2) format('woff2');
|
|
32
|
+
src: url(https://pro.fontawesome.com/releases/v6.0.0-beta1/webfonts/fa-solid-900.woff2) format('woff2');
|
|
33
|
+
}
|
|
34
|
+
@font-face {
|
|
35
|
+
font-family: 'LigatureSymbols url';
|
|
36
|
+
font-style: normal;
|
|
37
|
+
font-weight: 400;
|
|
38
|
+
src: url(https://rawcdn.githack.com/kudakurage/LigatureSymbols/d54f43cd72d190b7a3c0b2ee1644fac770b4a146/LigatureSymbols-2.11.woff) format('woff');
|
|
39
|
+
}
|
|
40
|
+
@font-face {
|
|
41
|
+
font-family: 'NotoEmoji url';
|
|
42
|
+
src: url(https://cdn.jsdelivr.net/gh/googlefonts/noto-emoji@2.038/fonts/NotoEmoji-Regular.ttf);
|
|
43
|
+
}
|
|
44
|
+
@font-face { /* http://emojione.com/developers/ */
|
|
45
|
+
font-family: 'Emojione url';
|
|
46
|
+
src: url("https://cdn.rawgit.com/Ranks/emojione/master/assets/fonts/emojione-svg.woff2") format("woff2");
|
|
47
|
+
}
|
|
48
|
+
@font-face {
|
|
49
|
+
font-family: 'Material Icons url';
|
|
50
|
+
src: url(https://fonts.gstatic.com/s/materialicons/v129/flUhRq6tzZclQEJ-Vdg-IuiaDsNc.woff2) format('woff2');
|
|
51
|
+
}
|
|
52
|
+
@font-face {
|
|
53
|
+
font-family: 'Material Symbols Outlined url';
|
|
54
|
+
src: url(https://fonts.gstatic.com/s/materialsymbolsoutlined/v7/kJF1BvYX7BgnkSrUwT8OhrdQw4oELdPIeeII9v6oDMzByHX9rA6RzaxHMPdY43zj-jCxv3fzvRNU22ZXGJpEpjC_1v-p_4MrImHCIJIZrDCvHOej.woff2) format('woff2');
|
|
55
|
+
}
|
|
56
|
+
@font-face {
|
|
57
|
+
font-family: 'openmoji';
|
|
58
|
+
src: url(https://raw.githubusercontent.com/hfg-gmuend/openmoji/master/font/OpenMoji-Color.ttf) format('truetype');
|
|
59
|
+
}
|
|
60
|
+
@font-face {
|
|
61
|
+
font-family: 'openmoji bw';
|
|
62
|
+
src: url(https://raw.githubusercontent.com/hfg-gmuend/openmoji/master/font/OpenMoji-Black.ttf) format('truetype');
|
|
63
|
+
}
|
|
64
|
+
@font-face {
|
|
65
|
+
font-family: 'twemoji';
|
|
66
|
+
src: url(https://cdn.jsdelivr.net/npm/twemoji-colr-font@14.0.2/twemoji.woff2) format('woff2');
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
u2-ico.afterHack:after { /* chrome does not need :after-trick (why? => because it uses segoe ui symbol as font?) , but ff, not working in safari :( */
|
|
70
|
+
content: "\00FE0E";
|
|
71
|
+
font:inherit;
|
|
72
|
+
/* for safari (it displays a stupid rect) */
|
|
73
|
+
xopacity:0;
|
|
74
|
+
}
|
|
75
|
+
u2-ico.proposed {
|
|
76
|
+
font-palette: dark; /* ff-107 ch-101 s-15.4 */
|
|
77
|
+
font-variant-emoji: text; /* safari, ff-108 (seams not to work correct) */
|
|
78
|
+
text-transform: text; /* proposed */
|
|
79
|
+
font-variant-color: monochrome; /* proposed */
|
|
80
|
+
font-color: monochrome; /* proposed */
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/*
|
|
84
|
+
https://stackoverflow.com/a/40020609/4865307
|
|
85
|
+
https://docs.google.com/spreadsheets/d/1KQDH9uArJr-8m4UvAEd02ixaX_-wauSwjy9qYCwIOvE/edit#gid=645289137
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
# emoji list
|
|
89
|
+
https://apps.timwhitlock.info/emoji/tables/unicode
|
|
90
|
+
https://www.unicode.org/emoji/charts/full-emoji-list.html
|
|
91
|
+
|
|
92
|
+
# monochrome emoji fonts
|
|
93
|
+
|
|
94
|
+
Noto Emoji
|
|
95
|
+
https://www.fontspace.com/noto-emoji-font-f22283
|
|
96
|
+
cdn: https://cdn.jsdelivr.net/gh/googlefonts/noto-emoji@2.038/fonts/NotoEmoji-Regular.ttf
|
|
97
|
+
|
|
98
|
+
Symbola Font
|
|
99
|
+
https://www.fontspace.com/symbola-font-f22021
|
|
100
|
+
|
|
101
|
+
Code2003
|
|
102
|
+
https://www.fontspace.com/code2003-font-f24444
|
|
103
|
+
|
|
104
|
+
Unifont Font (pixelated)
|
|
105
|
+
https://www.fontspace.com/unifont-font-f26370
|
|
106
|
+
|
|
107
|
+
EmojiSymbols Font (c)blockworks - Kenichi Kaneko (attribution required)
|
|
108
|
+
http://emojisymbols.com/
|
|
109
|
+
|
|
110
|
+
*/
|
|
111
|
+
</style>
|
|
112
|
+
|
|
113
|
+
<h2>UTF-8 flat symbols system</h2>
|
|
114
|
+
<div>
|
|
115
|
+
<input onchange="document.querySelectorAll('u2-ico').forEach(el=>{ [...el.innerHTML].length === 1 && (el.innerHTML = this.value) })">
|
|
116
|
+
<h3>Times</h3>
|
|
117
|
+
<table>
|
|
118
|
+
<tr>
|
|
119
|
+
<td>Font Family
|
|
120
|
+
<td> 🔍
|
|
121
|
+
<td>proposed features
|
|
122
|
+
<td>::after hack
|
|
123
|
+
<td>ligatures
|
|
124
|
+
<tr style="--u2-ico-font:times">
|
|
125
|
+
<td> times
|
|
126
|
+
<td> <u2-ico>🔍</u2-ico>
|
|
127
|
+
<td> <u2-ico class="proposed">🔍</u2-ico>
|
|
128
|
+
<td> <u2-ico class="afterHack">🔍</u2-ico>
|
|
129
|
+
<td> <u2-ico class="ligatures">search</u2-ico>
|
|
130
|
+
<tr style="--u2-ico-font:'Segoe UI Symbol'">
|
|
131
|
+
<td> Segoe UI Symbol
|
|
132
|
+
<td> <u2-ico>🔍</u2-ico>
|
|
133
|
+
<td> <u2-ico class="proposed">🔍</u2-ico>
|
|
134
|
+
<td> <u2-ico class="afterHack">🔍</u2-ico>
|
|
135
|
+
<td> <u2-ico class="ligatures">search</u2-ico>
|
|
136
|
+
<tr style="--u2-ico-font:'segoe local'">
|
|
137
|
+
<td> Segoe UI Symbol local()
|
|
138
|
+
<td> <u2-ico>🔍</u2-ico>
|
|
139
|
+
<td> <u2-ico class="proposed">🔍</u2-ico>
|
|
140
|
+
<td> <u2-ico class="afterHack">🔍</u2-ico>
|
|
141
|
+
<td> <u2-ico class="ligatures">search</u2-ico>
|
|
142
|
+
<tr style="--u2-ico-font:'Noto Emoji'">
|
|
143
|
+
<td> Noto Emoji
|
|
144
|
+
<td> <u2-ico>🔍</u2-ico>
|
|
145
|
+
<td> <u2-ico class="proposed">🔍</u2-ico>
|
|
146
|
+
<td> <u2-ico class="afterHack">🔍</u2-ico>
|
|
147
|
+
<td> <u2-ico class="ligatures">search</u2-ico>
|
|
148
|
+
<tr style="--u2-ico-font:'NotoEmoji url'">
|
|
149
|
+
<td> NotoEmoji url()
|
|
150
|
+
<td> <u2-ico>🔍</u2-ico>
|
|
151
|
+
<td> <u2-ico class="proposed">🔍</u2-ico>
|
|
152
|
+
<td> <u2-ico class="afterHack">🔍</u2-ico>
|
|
153
|
+
<td> <u2-ico class="ligatures">search</u2-ico>
|
|
154
|
+
<tr style="--u2-ico-font:'Font Awesome url'">
|
|
155
|
+
<td> Font Awesome url()
|
|
156
|
+
<td> <u2-ico>🔍</u2-ico>
|
|
157
|
+
<td> <u2-ico class="proposed">🔍</u2-ico>
|
|
158
|
+
<td> <u2-ico class="afterHack">🔍</u2-ico>
|
|
159
|
+
<td> <u2-ico class="ligatures">search</u2-ico>
|
|
160
|
+
<tr style="--u2-ico-font:'openmoji bw'">
|
|
161
|
+
<td> OpenMoji bw url()
|
|
162
|
+
<td> <u2-ico>🔍</u2-ico>
|
|
163
|
+
<td> <u2-ico class="proposed">🔍</u2-ico>
|
|
164
|
+
<td> <u2-ico class="afterHack">🔍</u2-ico>
|
|
165
|
+
<td> <u2-ico class="ligatures">search</u2-ico>
|
|
166
|
+
|
|
167
|
+
<tr style="--u2-ico-font:'openmoji'">
|
|
168
|
+
<td> OpenMoji url()
|
|
169
|
+
<td> <u2-ico>🔍</u2-ico>
|
|
170
|
+
<td> <u2-ico class="proposed">🔍</u2-ico>
|
|
171
|
+
<td> <u2-ico class="afterHack">🔍</u2-ico>
|
|
172
|
+
<td> <u2-ico class="ligatures">search</u2-ico>
|
|
173
|
+
<tr style="--u2-ico-font:'twemoji'">
|
|
174
|
+
<td> twemoji url()
|
|
175
|
+
<td> <u2-ico>🔍</u2-ico>
|
|
176
|
+
<td> <u2-ico class="proposed">🔍</u2-ico>
|
|
177
|
+
<td> <u2-ico class="afterHack">🔍</u2-ico>
|
|
178
|
+
<td> <u2-ico class="ligatures">search</u2-ico>
|
|
179
|
+
|
|
180
|
+
<tr style="--u2-ico-font:'Material Icons url'">
|
|
181
|
+
<td> Material Icons url()
|
|
182
|
+
<td> <u2-ico>🔍</u2-ico>
|
|
183
|
+
<td> <u2-ico class="proposed">🔍</u2-ico>
|
|
184
|
+
<td> <u2-ico class="afterHack">🔍</u2-ico>
|
|
185
|
+
<td> <u2-ico class="ligatures">search</u2-ico>
|
|
186
|
+
<tr style="--u2-ico-font:'Material Symbols Outlined url'">
|
|
187
|
+
<td> Material Symbols Outlined url()
|
|
188
|
+
<td> <u2-ico>🔍</u2-ico>
|
|
189
|
+
<td> <u2-ico class="proposed">🔍</u2-ico>
|
|
190
|
+
<td> <u2-ico class="afterHack">🔍</u2-ico>
|
|
191
|
+
<td> <u2-ico class="ligatures">search</u2-ico>
|
|
192
|
+
<tr style="--u2-ico-font:'LigatureSymbols url'">
|
|
193
|
+
<td> LigatureSymbols url()
|
|
194
|
+
<td> <u2-ico>🔍</u2-ico>
|
|
195
|
+
<td> <u2-ico class="proposed">🔍</u2-ico>
|
|
196
|
+
<td> <u2-ico class="afterHack">🔍</u2-ico>
|
|
197
|
+
<td> <u2-ico class="ligatures">search</u2-ico>
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
<!--tr style="--u2-ico-font:'Emojione url'">
|
|
201
|
+
<td> Emojione url()
|
|
202
|
+
<td> <u2-ico>🔍</u2-ico>
|
|
203
|
+
<td> <u2-ico class="proposed">🔍</u2-ico>
|
|
204
|
+
<td> <u2-ico class="afterHack">🔍</u2-ico-->
|
|
205
|
+
|
|
206
|
+
</table>
|
|
207
|
+
|
|
208
|
+
SVG experiment:
|
|
209
|
+
<svg width="100" height="100" style="border:1px solid; display:block; font-family: 'Material Symbols Outlined url'; overflow:visible">
|
|
210
|
+
<text x="50" y="50" dominant-baseline="middle" text-anchor="middle" font-size="50" clip-path="url(#clip-emoji)" style="outline:1px solid">🔍</text>
|
|
211
|
+
</svg>
|
|
212
|
+
|
|
213
|
+
</div>
|