googlearchive / core-icons

core-icons
41 stars 18 forks source link

Usage with angular-material #6

Closed wilsonjackson closed 10 years ago

wilsonjackson commented 10 years ago

I'd like to use this repo in a project using angular-material. My intention would be to translate these files into Angular templates (link tags would be stripped) and write a custom directive to access them. As such, I would not use bower to install this dependency, but would clone the repo directly or add it as a git submodule.

My question is whether this is permissible under the license. If so, are there any special considerations I should make, such as prepending the license to an Angular template file generated from these sources?

ghost commented 10 years ago

+1 for this issue... I woud love to have this...

ebidel commented 10 years ago

Polymer's license is captured here: http://polymer.github.io/LICENSE.txt. You need to preserve the license header and copyright information.

Out of curiosity, why duplicate work by creating a directive? A custom element already exists (core-icon and friends) to handle the icons sets. That's sort of the beauty of components...they're easy to reuse and drop-in.

wilsonjackson commented 10 years ago

Thanks for the info, though it seems my project may be acquiring icons from another source now.

The reason for not using the custom element is that the app is built using angular and adding another framework just for some icons would be too heavy. In the future, when angular handles web components natively as is their intention (or when native browser support is better) using the core-icon element directly will be a better option.

The angular-material project itself is still extremely young, and will, I believe, eventually offer icon directives roughly equivalent to the ones in polymer. They're just not there yet.

ebidel commented 10 years ago

I think you're misrepresenting web components. Everything is extremely modular. There's no framework buy-in. You 1.) import the element and 2.) start using it:

<link rel="import" href="core-icons.html>
<core-icon icon="search"></core-icon>

Notice there's no notion of "a framework" in that usage. Polymer itself is not even mentioned :) For all we know, core-icons.html could have been implemented with raw custom elements, polymer.dart, or x-tags.

For now, yes, you also need to load platform.js in browsers other than Chrome. But that is a stopgap. Even if Angular builds support for web components, you'll still need this polyfill layer if you're targeting other browsers. I don't see how using core-icon directly becomes better in that case.

wilsonjackson commented 10 years ago

Referring to the platform polyfill as a framework was my mistake; it's not one. What I mean is a >100KB js include is too heavy for something I can implement in ~50loc using a framework I'm already heavily depending on. If it were my intention to use more than just core-icons, I wouldn't be so hesitant.

I agree with you about web components, and I look forward to the day I can use them freely, but for me that day isn't here yet (not for this project, anyhow).