material icon indicating copy to clipboard operation
material copied to clipboard

Document CSS API

Open ajoslin opened this issue 12 years ago • 11 comments

Add a 'CSS' section to the documentation for each component, and decide on good CSS classes where they don't exist yet.

ajoslin avatar Nov 10 '14 21:11 ajoslin

@ajoslin - I cannot recall; why this is needed ?

ThomasBurleson avatar Nov 14 '14 00:11 ThomasBurleson

This was something I proposed. Without documenting anything at all, it's impossible to say if changes to CSS classes are considered breaking. By documenting a CSS API, you make explicit what you expect people can use to customize components, and anything not documented is considered private and subject to change at any time.

The given API for any component could be very small (maybe just the root element and modifiers), or more detailed (a class for each logical part), but the important thing is to make it explicit.

jelbourn avatar Nov 14 '14 15:11 jelbourn

:+1: This is great because now it will be easier to interact with designers who want to work with clean css :-)

david-gang avatar Feb 24 '15 07:02 david-gang

This is a great idea!

We feel hesitant using some classes because we don't know if they are gonna disappear or change in future releases. This feeling is increased by the fact that some classes are documented (I'm thinking about .md-whiteframe-z*), while others can only be found on (sometimes unrelated) examples (e.g. .md-mini).

bonzanni avatar Feb 26 '15 09:02 bonzanni

@david-gang , @nicbon - Documenting CSS is definitely on our roadmap. The Angular Material team is currently focused on implementation of components for the planned Q2 1.0 release. Perhaps you guys could help us and create a initial CSS markdown document (submit via PR)?

ThomasBurleson avatar Feb 26 '15 13:02 ThomasBurleson

@ThomasBurleson I will be happy to document every css class i make a customization on. What should be the name of the file and where should it be located ?

david-gang avatar Feb 26 '15 13:02 david-gang

@david-gang - As you prepare this document, I will connect with you as a formal contributor and we can dialog as needed so I can help with questions, suggestions, and feedback. What is your email? I will contact you and we can discuss ideas on CSS documentation.

The 1st question is whether to have a separate CSS section that discusses the CSS for all components or the enhancement of each component's online docs with a CSS section. Currently, the component docs have Usage and Attributes sections; we could easily add a "CSS" section there; but that would require jsDocs instead of markdown docs.

ThomasBurleson avatar Feb 26 '15 16:02 ThomasBurleson

@david-gang Thanks for doing this. As a front-end developer, I appreciate it. Having worked with many UI frameworks, I would suggest that Bootstrap has the best and easiest-to-follow documentation and might be a good reference point.

lee-40square avatar Feb 26 '15 22:02 lee-40square

Thank you for the reference, @ThomasBurleson.

From the linked issue:

"As a user, I expect the demos to be copy/paste and "just work"; instead, I need to dig into the docs.css to get the same visual styles."

As a developer who works with designers (and fears the days he must dabble in design himself), this is a critical story for "working" demos.

DavidSouther avatar Feb 28 '15 16:02 DavidSouther

related: https://github.com/angular/material-start/issues/19

lookfirst avatar Mar 24 '15 19:03 lookfirst

:+1: really happy to see this being worked on!

mprentic-harris avatar Apr 06 '15 17:04 mprentic-harris