Giter VIP home page Giter VIP logo

core-style's Introduction

core-style's People

Contributors

0x-r4bbit avatar addyosmani avatar dfreedm avatar garlicnation avatar rnowm avatar robdodson avatar sorvell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

core-style's Issues

IE11 support?

The core-style demo currently looks different in IE11 compared to Chrome/Firefox. The numbers in the cards have different colors assigned in IE11. Shouldn't the result be equal in all supported browsers?

Question: Is this element obsolete if I use CSS preprocessors?

Having a detailed research I ended up here:
Polymer/polymer#1052 (comment)

I am understanding it right: Core-style simply shares bits of CSS across elements?

If this is so I can use something like SASS or LESS, right? And simply share a partial or variables across my elements styling?

May be I can ask the question in this way: is core-style intended for the developers that want or are forced to use vanilla CSS for styling?

I cant think of a scenario where a preprocessor like SASS would't fit a use-case that core-style does.

Multiple core-style id's

view-source:https://www.polymer-project.org/components/core-style/demo.html
view-source:https://www.polymer-project.org/components/core-style/my-theme.html
view-source:https://www.polymer-project.org/components/core-style/elements.html

Would be less confusing if elements.html used inline <style> tags and my-theme.html <core-style>

Using multiple core-styles with the same id can't be good considering vulcanizing etc.

2x <core-style id="my-toolbar">
2x <core-style id="my-panel">

Support parametrized producer refinement

The idea is to allow local customization of the variables in producers.

An example use case would be:

  1. adding a paper input on an blue toolbar
  2. I'd like to make it's colors white so they look ok on the blue background
  3. all while keeping the global paper-inputs colors unaltered.

Since there are already customization vars in the producer, I'd prefer not to write a ton of CSS all over again, but to reuse the existing producer with new, local, variables.

Sample API:

<!-- global params -->
<script>
  CoreStyle.g.myColor = red;
</script>

<!-- parameterized producer -->
<core-style id="myProducer">
  selector {
    color: {{g.myColor}}; /* default to CoreStyle.params.myColor */
  }
</core-style>

<!-- refined producer -->
<core-style refines="myProducer" select=".css-selector">
  g.myColor = red; // local parameter just for this instance
</core-style>

The select=".css-selector" could be used to target a subset of elements that have a paired consumer, so it can be applied selectively.

If the select attribute would be missing the refinement would apply globally.

Doc generation breaks paragraph

Hi there.

I read the core-style docs and saw the following sentence:

screen shot 2014-07-31 at 10 01 21

It kind of looked like that the period shouldn't be there and that this sentence really wants to say: "Using core-style in HTML Imports is currently not supported.".

Since I think that using core-style inside HTML Imports is the actual win, I wanted to open an issue and ask what the status of this thing is.

But when we look at the source file where the actual documentation is written, we see this: https://github.com/Polymer/core-style/blob/master/core-style.html#L20-L22

So it seems that core-component-page breaks that paragraph (and using core-style in HTML Imports is supported). I haven't looked at the exact issue yet, but I have a feeling that it has something to do with the @import in the sentence.

<core-style ref=...> tags are never deallocated

The core-style consumers are added in global refMap but are never removed.
Looks like a function to undo registerRef() is missing in detached

unregisterRef: function() {
    var idx = this.refMap[this.ref].indexOf(this);
    if(idx >= 0)
        this.refMap[this.ref].splice(idx, 1);
}

This is an issue because this prevents all the template instances of elements using core-style from being deallocated.

core-style should allow for external CSS

It would be pretty neat if core-style could, instead of embedding a string of CSS within the core-style tag, include 1 or many link rel stylesheets that point to actual CSS files.

Issue with Chrome / Chromium

Looks like any space outside the parenthesis is converted to  

  <core-style id="main">
    body {background-color:#000000;}
  </core-style>

It's working fine on FF and Safari, but not on Chrome.
Here is the generated result:

<core-style id="main" hidden="">
"body&nbsp;{background-color:#000000;}"
</core-style>

<core-style> should use an element that parses in plain text mode

ex.

<style is="core-style" type="polymer/style">
    .span::before { content: "<script>alert(1)</script>"; }
</style>

Using today to do that will alert since it just has random HTML inside it which is both slower for the parser, and will interpret stuff inside it as tags. Instead it should work as above.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.