mirror of
https://github.com/CoderSherlock/CoderSherlock.github.io.git
synced 2026-06-13 08:08:10 -07:00
I_changed_another_theme
This commit is contained in:
+43
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"name": "iron-icon",
|
||||
"private": true,
|
||||
"version": "1.0.2",
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"description": "An element that supports displaying an icon",
|
||||
"main": "iron-icon.html",
|
||||
"author": [
|
||||
"The Polymer Authors"
|
||||
],
|
||||
"keywords": [
|
||||
"web-components",
|
||||
"polymer",
|
||||
"icon"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/PolymerElements/iron-icon.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"iron-flex-layout": "polymerelements/iron-flex-layout#^1.0.0",
|
||||
"iron-meta": "polymerelements/iron-meta#^1.0.0",
|
||||
"polymer": "Polymer/polymer#^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"test-fixture": "polymerelements/test-fixture#^1.0.0",
|
||||
"iron-iconset": "polymerelements/iron-iconset#^1.0.0",
|
||||
"iron-icons": "polymerelements/iron-icons#^1.0.0",
|
||||
"iron-component-page": "polymerelements/iron-component-page#^1.0.0",
|
||||
"web-component-tester": "*",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
},
|
||||
"homepage": "https://github.com/polymerelements/iron-icon",
|
||||
"_release": "1.0.2",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.0.2",
|
||||
"commit": "f9246c47ecb1c682f0fb9ea48255d5f7debd1e03"
|
||||
},
|
||||
"_source": "git://github.com/polymerelements/iron-icon.git",
|
||||
"_target": "^1.0.0",
|
||||
"_originalSource": "polymerelements/iron-icon"
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
bower_components
|
||||
Vendored
+56
@@ -0,0 +1,56 @@
|
||||
iron-icon
|
||||
=========
|
||||
|
||||
The `iron-icon` element displays an icon. By default an icon renders as a 24px square.
|
||||
|
||||
Example using src:
|
||||
|
||||
```html
|
||||
<iron-icon src="star.png"></iron-icon>
|
||||
```
|
||||
|
||||
Example setting size to 32px x 32px:
|
||||
|
||||
```html
|
||||
<iron-icon class="big" src="big_star.png"></iron-icon>
|
||||
|
||||
<style>
|
||||
.big {
|
||||
height: 32px;
|
||||
width: 32px;
|
||||
}
|
||||
</style>
|
||||
```
|
||||
|
||||
The iron elements include several sets of icons.
|
||||
To use the default set of icons, import `iron-icons.html` and use the `icon` attribute to specify an icon:
|
||||
|
||||
```html
|
||||
<!-- import default iconset and iron-icon -->
|
||||
<link rel="import" href="/components/iron-icons/iron-icons.html">
|
||||
|
||||
<iron-icon icon="menu"></iron-icon>
|
||||
```
|
||||
|
||||
To use a different built-in set of icons, import `iron-icons/<iconset>-icons.html`, and
|
||||
specify the icon as `<iconset>:<icon>`. For example:
|
||||
|
||||
```html
|
||||
<!-- import communication iconset and iron-icon -->
|
||||
<link rel="import" href="/components/iron-icons/communication-icons.html">
|
||||
|
||||
<iron-icon icon="communication:email"></iron-icon>
|
||||
```
|
||||
|
||||
You can also create custom icon sets of bitmap or SVG icons.
|
||||
|
||||
Example of using an icon named `cherry` from a custom iconset with the ID `fruit`:
|
||||
|
||||
```html
|
||||
<iron-icon icon="fruit:cherry"></iron-icon>
|
||||
```
|
||||
|
||||
See [iron-iconset](#iron-iconset) and [iron-iconset-svg](#iron-iconset-svg) for more information about
|
||||
how to create a custom iconset.
|
||||
|
||||
See [iron-icons](http://www.polymer-project.org/components/iron-icons/demo.html) for the default set of icons.
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"name": "iron-icon",
|
||||
"private": true,
|
||||
"version": "1.0.2",
|
||||
"license": "http://polymer.github.io/LICENSE.txt",
|
||||
"description": "An element that supports displaying an icon",
|
||||
"main": "iron-icon.html",
|
||||
"author": [
|
||||
"The Polymer Authors"
|
||||
],
|
||||
"keywords": [
|
||||
"web-components",
|
||||
"polymer",
|
||||
"icon"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/PolymerElements/iron-icon.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"iron-flex-layout": "polymerelements/iron-flex-layout#^1.0.0",
|
||||
"iron-meta": "polymerelements/iron-meta#^1.0.0",
|
||||
"polymer": "Polymer/polymer#^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"test-fixture": "polymerelements/test-fixture#^1.0.0",
|
||||
"iron-iconset": "polymerelements/iron-iconset#^1.0.0",
|
||||
"iron-icons": "polymerelements/iron-icons#^1.0.0",
|
||||
"iron-component-page": "polymerelements/iron-component-page#^1.0.0",
|
||||
"web-component-tester": "*",
|
||||
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
|
||||
}
|
||||
}
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
<!doctype html>
|
||||
<!--
|
||||
@license
|
||||
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
<title>iron-icon demo</title>
|
||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
<link rel="import" href="../iron-icon.html">
|
||||
<link rel="import" href="../../iron-iconset/iron-iconset.html">
|
||||
<link href="../../paper-styles/demo-pages.html" rel="import">
|
||||
|
||||
<style is="custom-style">
|
||||
.vertical-section h4 {
|
||||
border-left: 3px solid var(--paper-grey-300);
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
.vertical-section h4:hover {
|
||||
border-left-color: var(--google-blue-700);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="vertical-section-container centered">
|
||||
<h4>This demo is for a single <iron-icon>. If you're looking for the
|
||||
whole set of available icons, check out the <iron-icons> demo.</h4>
|
||||
|
||||
<div class="vertical-section">
|
||||
<!-- iron-icon using a iron-iconset as its icon source -->
|
||||
<iron-iconset name="example" icons="location" src="location.png" size="24" width="24"></iron-iconset>
|
||||
|
||||
<h4><iron-icon icon="example:location"></h4>
|
||||
<iron-icon icon="example:location"></iron-icon>
|
||||
|
||||
<!-- iron-icon using an image url as its icon source -->
|
||||
<h4><iron-icon src="location.png"></h4>
|
||||
<iron-icon src="location.png"></iron-icon>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 324 B |
Vendored
+19
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 17.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
viewBox="0 0 225 126" enable-background="new 0 0 225 126" xml:space="preserve">
|
||||
<g id="background" display="none">
|
||||
<rect display="inline" fill="#B0BEC5" width="225" height="126"/>
|
||||
</g>
|
||||
<g id="label">
|
||||
</g>
|
||||
<g id="art">
|
||||
<circle cx="112" cy="61" r="8"/>
|
||||
<path d="M129,78H95V44h34V78z M97,76h30V46H97V76z"/>
|
||||
<g id="ic_x5F_add_x0D_">
|
||||
</g>
|
||||
</g>
|
||||
<g id="Guides">
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 739 B |
+26
@@ -0,0 +1,26 @@
|
||||
<!doctype html>
|
||||
<!--
|
||||
@license
|
||||
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS
|
||||
-->
|
||||
<html>
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<script src="../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
<link rel="import" href="../iron-component-page/iron-component-page.html">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<iron-component-page></iron-component-page>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
+179
@@ -0,0 +1,179 @@
|
||||
<!--
|
||||
@license
|
||||
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
-->
|
||||
|
||||
<link rel="import" href="../polymer/polymer.html">
|
||||
<link rel="import" href="../iron-meta/iron-meta.html">
|
||||
<link rel="import" href="../iron-flex-layout/iron-flex-layout.html">
|
||||
|
||||
<!--
|
||||
|
||||
The `iron-icon` element displays an icon. By default an icon renders as a 24px square.
|
||||
|
||||
Example using src:
|
||||
|
||||
<iron-icon src="star.png"></iron-icon>
|
||||
|
||||
Example setting size to 32px x 32px:
|
||||
|
||||
<iron-icon class="big" src="big_star.png"></iron-icon>
|
||||
|
||||
<style is="custom-style">
|
||||
.big {
|
||||
--iron-icon-height: 32px;
|
||||
--iron-icon-width: 32px;
|
||||
}
|
||||
</style>
|
||||
|
||||
The iron elements include several sets of icons.
|
||||
To use the default set of icons, import `iron-icons.html` and use the `icon` attribute to specify an icon:
|
||||
|
||||
<!-- import default iconset and iron-icon -->
|
||||
<link rel="import" href="/components/iron-icons/iron-icons.html">
|
||||
|
||||
<iron-icon icon="menu"></iron-icon>
|
||||
|
||||
To use a different built-in set of icons, import `iron-icons/<iconset>-icons.html`, and
|
||||
specify the icon as `<iconset>:<icon>`. For example:
|
||||
|
||||
<!-- import communication iconset and iron-icon -->
|
||||
<link rel="import" href="/components/iron-icons/communication-icons.html">
|
||||
|
||||
<iron-icon icon="communication:email"></iron-icon>
|
||||
|
||||
You can also create custom icon sets of bitmap or SVG icons.
|
||||
|
||||
Example of using an icon named `cherry` from a custom iconset with the ID `fruit`:
|
||||
|
||||
<iron-icon icon="fruit:cherry"></iron-icon>
|
||||
|
||||
See [iron-iconset](#iron-iconset) and [iron-iconset-svg](#iron-iconset-svg) for more information about
|
||||
how to create a custom iconset.
|
||||
|
||||
See [iron-icons](https://elements.polymer-project.org/elements/iron-icons?view=demo:demo/index.html) for the default set of icons.
|
||||
|
||||
|
||||
### Styling
|
||||
|
||||
The following custom properties are available for styling:
|
||||
|
||||
Custom property | Description | Default
|
||||
----------------|-------------|----------
|
||||
`--iron-icon-width` | Width of the icon | `24px`
|
||||
`--iron-icon-height` | Height of the icon | `24px`
|
||||
|
||||
@group Iron Elements
|
||||
@element iron-icon
|
||||
@demo demo/index.html
|
||||
@hero hero.svg
|
||||
@homepage polymer.github.io
|
||||
-->
|
||||
|
||||
<dom-module id="iron-icon">
|
||||
|
||||
<style>
|
||||
:host {
|
||||
@apply(--layout-inline);
|
||||
@apply(--layout-center-center);
|
||||
position: relative;
|
||||
|
||||
vertical-align: middle;
|
||||
|
||||
fill: currentcolor;
|
||||
|
||||
width: var(--iron-icon-width, 24px);
|
||||
height: var(--iron-icon-height, 24px);
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
<iron-meta id="meta" type="iconset"></iron-meta>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
Polymer({
|
||||
|
||||
is: 'iron-icon',
|
||||
|
||||
properties: {
|
||||
|
||||
/**
|
||||
* The name of the icon to use. The name should be of the form:
|
||||
* `iconset_name:icon_name`.
|
||||
*/
|
||||
icon: {
|
||||
type: String,
|
||||
observer: '_iconChanged'
|
||||
},
|
||||
|
||||
/**
|
||||
* The name of the theme to used, if one is specified by the
|
||||
* iconset.
|
||||
*/
|
||||
theme: {
|
||||
type: String,
|
||||
observer: '_updateIcon'
|
||||
},
|
||||
|
||||
/**
|
||||
* If using iron-icon without an iconset, you can set the src to be
|
||||
* the URL of an individual icon image file. Note that this will take
|
||||
* precedence over a given icon attribute.
|
||||
*/
|
||||
src: {
|
||||
type: String,
|
||||
observer: '_srcChanged'
|
||||
}
|
||||
},
|
||||
|
||||
_DEFAULT_ICONSET: 'icons',
|
||||
|
||||
_iconChanged: function(icon) {
|
||||
var parts = (icon || '').split(':');
|
||||
this._iconName = parts.pop();
|
||||
this._iconsetName = parts.pop() || this._DEFAULT_ICONSET;
|
||||
this._updateIcon();
|
||||
},
|
||||
|
||||
_srcChanged: function(src) {
|
||||
this._updateIcon();
|
||||
},
|
||||
|
||||
_usesIconset: function() {
|
||||
return this.icon || !this.src;
|
||||
},
|
||||
|
||||
_updateIcon: function() {
|
||||
if (this._usesIconset()) {
|
||||
if (this._iconsetName) {
|
||||
this._iconset = this.$.meta.byKey(this._iconsetName);
|
||||
if (this._iconset) {
|
||||
this._iconset.applyIcon(this, this._iconName, this.theme);
|
||||
} else {
|
||||
this._warn(this._logf('_updateIcon', 'could not find iconset `'
|
||||
+ this._iconsetName + '`, did you import the iconset?'));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!this._img) {
|
||||
this._img = document.createElement('img');
|
||||
this._img.style.width = '100%';
|
||||
this._img.style.height = '100%';
|
||||
}
|
||||
this._img.src = this.src;
|
||||
Polymer.dom(this.root).appendChild(this._img);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
</dom-module>
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
<!doctype html>
|
||||
<!--
|
||||
@license
|
||||
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
-->
|
||||
|
||||
<html>
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<title>Tests</title>
|
||||
<script src="../../web-component-tester/browser.js"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<script>
|
||||
|
||||
WCT.loadSuites([
|
||||
'iron-icon.html'
|
||||
]);
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
+120
@@ -0,0 +1,120 @@
|
||||
<!doctype html>
|
||||
<!--
|
||||
@license
|
||||
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
|
||||
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
|
||||
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
||||
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
||||
Code distributed by Google as part of the polymer project is also
|
||||
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
||||
-->
|
||||
|
||||
<html>
|
||||
<head>
|
||||
|
||||
<title>iron-icon</title>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>
|
||||
<script src="../../web-component-tester/browser.js"></script>
|
||||
<script src="../../test-fixture/test-fixture-mocha.js"></script>
|
||||
|
||||
<link rel="import" href="../iron-icon.html">
|
||||
<link rel="import" href="../../iron-iconset/iron-iconset.html">
|
||||
<link rel="import" href="../../test-fixture/test-fixture.html">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<test-fixture id="TrivialIcon">
|
||||
<template>
|
||||
<iron-icon src="../demo/location.png"></iron-icon>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<test-fixture id="IconFromIconset">
|
||||
<template>
|
||||
<iron-iconset name="example" icons="location blank" src="location.png" size="24" width="48"></iron-iconset>
|
||||
<iron-icon icon="example:location"></iron-icon>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<test-fixture id="WithoutAnIconSource">
|
||||
<template>
|
||||
<iron-icon icon=""></iron-icon>
|
||||
<iron-icon></iron-icon>
|
||||
<iron-icon src=""></iron-icon>
|
||||
</template>
|
||||
</test-fixture>
|
||||
|
||||
<script>
|
||||
function iconElementFor (node) {
|
||||
var nodes = Polymer.dom(node.root).childNodes;
|
||||
|
||||
for (var i = 0; i < nodes.length; ++i) {
|
||||
if (nodes[i].nodeName.match(/DIV|IMG/)) {
|
||||
return nodes[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function hasIcon (node) {
|
||||
return /png/.test(node.style.backgroundImage);
|
||||
}
|
||||
|
||||
suite('<iron-icon>', function() {
|
||||
suite('basic behavior', function() {
|
||||
var icon;
|
||||
|
||||
setup(function() {
|
||||
icon = fixture('TrivialIcon');
|
||||
});
|
||||
|
||||
test('can be assigned an icon with the src attribute', function() {
|
||||
expect(iconElementFor(icon)).to.be.ok;
|
||||
expect(iconElementFor(icon).src).to.match(/demo\/location\.png/);
|
||||
});
|
||||
|
||||
test('can change its src dynamically', function() {
|
||||
icon.src = 'foo.png';
|
||||
|
||||
expect(iconElementFor(icon).src).to.match(/foo\.png/);
|
||||
});
|
||||
});
|
||||
|
||||
suite('when paired with an iconset', function() {
|
||||
var icon;
|
||||
|
||||
setup(function() {
|
||||
var elements = fixture('IconFromIconset');
|
||||
|
||||
icon = elements[1];
|
||||
});
|
||||
|
||||
test('can be assigned an icon from the iconset', function() {
|
||||
expect(hasIcon(icon)).to.be.ok;
|
||||
});
|
||||
|
||||
test('can change its icon dynamically', function() {
|
||||
var style = icon.style;
|
||||
|
||||
expect(style.backgroundPosition).to.match(/0(%|px) 0(%|px)/);
|
||||
|
||||
icon.icon = "example:blank";
|
||||
|
||||
expect(style.backgroundPosition).to.match(/-24px 0(%|px)/);
|
||||
});
|
||||
});
|
||||
|
||||
suite('when no icon source is provided', function() {
|
||||
test('will politely wait for an icon source without throwing', function() {
|
||||
document.createElement('iron-icon');
|
||||
fixture('WithoutAnIconSource');
|
||||
});
|
||||
})
|
||||
});
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user