-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consistency between element classes, attributes and variables. #1011
Comments
This includes also variable names for example the use of https://www.polymer-project.org/docs/polymer/polymer.html <polymer-element name="my-component">
<template>
<app-globals id="globals"></app-globals>
<div id="firstname">{{$.globals.firstName}}</div>
<div id="lastname">{{$.globals.lastName}}</div>
</template>
<script>
Polymer({
ready: function() {
console.log('Last name: ' + this.$.globals.lastName);
}
});
</script>
</polymer-element> https://www.polymer-project.org/docs/elements/core-elements.html#core-style <core-style id="x-test">
:host {
background-color: {{g.myColor}};
}
</core-style>
<script>
CoreStyle.g.myColor = 'tomato';
</script> |
Hi Gert, Your point about the consistency is well taken. I'm collecting notes for a style guide, and I've made a note of these issues. The core style one is a little bit different, I think. The "globals" example is just that -- a code example. You can use whatever ID you like for the element. The example uses the ID "globals" for clarity. In sample code, we frequently do things a little differently to make it easier to follow. On the other hand, the core-style element has a property named |
Yes |
Example of what I would think is maybe the most consistent? <core-header-panel>
<core-header>standard</core-header>
<core-content fit>content fits 100% below the header</core-content>
</core-header-panel> <core-toolbar class="tall">
<span flex>Hello World</span>
<div fit class="bottom" id="progressBar"></div>
</core-toolbar> <core-scroll-header-panel>
<core-toolbar>Header</core-toolbar>
<core-content>Content goes here...</core-content>
</core-scroll-header-panel> <core-drawer-panel rightDrawer>
<core-drawer> Drawer panel... </core-drawer>
<core-content> Main panel... </core-content>
</core-drawer-panel> Basically avoid To indicate a custom element is for example
This is going to break so many peoples code lol, I may need witness protection :) But in the end everybody will be a happier polymer developer :) |
Also consider to make it a rule that you can swap out a component from a element more easily <site-search label="Search" canBeCondensed condensed>
<core-icon-button icon="search"></core-icon-button>
</site-search> |
Closing this issue due to age and the release of version 1 of Polymer - please feel free to re-open if this is incorrect. |
This drives me nuts haha :p Who do I need to convince here that the mix between attributes and classes could be made a bit more consistent. Someone should sit down, make a list of all attributes and classes and make sure everybody is doing it the same way. Will this break everything? Yes but call it 0.6 i don't care, it should be ironed out. Restrict it to one way only, don't care which way just make it one way :)
https://www.polymer-project.org/docs/elements/core-elements.html#core-header-panel
https://www.polymer-project.org/docs/elements/core-elements.html#core-toolbar
https://www.polymer-project.org/docs/elements/core-elements.html#core-scroll-header-panel
https://www.polymer-project.org/docs/elements/core-elements.html#core-drawer-panel
Many more examples, just want to make a point.
The text was updated successfully, but these errors were encountered: