paper-dropdown-menu
paper-dropdown-menu copied to clipboard
Docs confusing - CSS hard to track down
In your demo, you have this snipped:
<paper-dropdown-menu label="Dinosaurs">
<paper-listbox class="dropdown-content">
<paper-item>allosaurus</paper-item>
<paper-item>brontosaurus</paper-item>
<paper-item>carcharodontosaurus</paper-item>
<paper-item>diplodocus</paper-item>
</paper-listbox>
</paper-dropdown-menu>
This snippet uses a CSS class (dropdown-content). Unfortunately, it's hard to track down where the CSS is coming from. Apparently, for efficiency purposes, someone created some reusable CSS (somewhere) that this example uses. But, for demo code, reusable CSS is less important than clarity. Please just put the CSS as part of the example. Thanks.
Also, what is paper-dropdown-menu-light? It is in the examples, but not clear what it is or why it's there. How does is differ from paper-dropdown-menu (without the -light suffix)? Thanks.
Thanks @StokeMasterJack. Here's what the docs should clarify:
-
The
dropdown-contentclass isn't used for styling, at all. It's used to identify the element that's going to be used as the content for the dropdown. In this example, that's a listbox. This is mentioned in the docs, but could be more explicit. Currently we say:"The child element with the class dropdown-content is used as the dropdown menu. This can be a paper-listbox, or any other or element that acts like an iron-selector."
"You provide a menu-like element to be displayed as the dropdown menu. This element must have
class="dropdown-content"(as shown in the example).The menu element be a paper-listbox, or any other element that acts like an iron-selector.
-
The -light version of the element should be documented, but basically it's a lighter-weight version of the element, recommended for pages where you're using a lot of dropdowns. (Note to whoever fixes this, it's missing from the bower.json
mainfield).
paper-dropdown-menu-light is documented here: https://github.com/PolymerElements/paper-dropdown-menu/blob/master/paper-dropdown-menu-light.html#L27
Yes, but: docs aren't getting picked up on the catalog:
https://elements.polymer-project.org/elements/paper-dropdown-menu
I think it just needs to get added to bower.json for the catalog's sake.