Skip to content
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

Add full-featured cards #20

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

boazy
Copy link
Contributor

@boazy boazy commented Nov 20, 2015

Added a more complete implementation of cards based on mixins.

Usage

MSX

  • Both titles specified as attributes:
   <CardTitle title='Title Text' subtitle='Subtitle Text' />
  • Subtitle attribute, title string child:
   <CardTitle subtitle='Subtitle text'>Title Text</CardTitle>
  • Subtitle attribute, explicit title element child:
   <CardTitle subtitle='Subtitle text'><CardTitleText>Title Text</CardTitleText></CardTitle>
  • Both title and subtitle are explicit child elements:
   <CardTitle>
     <CardTitleText>Title Text</CardTitleText>
     <CardSubtitleText>Subtitle Text</SubtitleText>
   </CardTitle>

m() syntax

  • Shorthand with two string children:
   m(CardTitle, 'Title Text', 'Subtitle Text')

Mixins are functions or objects which can be applied to any component to
modify or override its behavior.  Mixable components are componets which can
either be used alone, or used as mixin with other components.  elements. This
allows better representation of the MDL component model, where almost any MDL
component or even plain HTML element can be a grid container or a grid cell
and <a> tags can be buttons, for instance.
@UhhhWaitWhat
Copy link
Collaborator

Will have to be reworked after #28

@boazy
Copy link
Contributor Author

boazy commented Dec 9, 2015

Once #28 is merged into master and I know it's the final syntax, I'll rework it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants