Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save andreloureiro/62f66892c656c876d4815efe2dbae75e to your computer and use it in GitHub Desktop.
Save andreloureiro/62f66892c656c876d4815efe2dbae75e to your computer and use it in GitHub Desktop.
<html>
<head>
<script type="module" src="../src/mnml-card/index.js"></script>
<script type="module" src="../src/mnml-card-title/index.js"></script>
<script type="module" src="../src/mnml-card-content/index.js"></script>
<script type="module" src="../src/mnml-card-actions/index.js"></script>
<script type="module" src="../src/mnml-card-image/index.js"></script>
<script type="module" src="../src/mnml-button/index.js"></script>
<style>
.list {
width: 340px;
margin: 0 auto;
}
mnml-card {
display: block;
margin: 10px;
}
</style>
</head>
<body>
<div class="list">
<mnml-card>
<mnml-card-title slot="title">What's up</mnml-card-title>
<mnml-card-content slot="content">
<p>Lorem ipsum blabla.</p>
<p>Mimimi lorem ipsum ble foo bar:</p>
<ol>
<li>One</li>
<li>Two</li>
<li>Three</li>
</ol>
</mnml-card-content>
</mnml-card>
<mnml-card>
<mnml-card-title slot="title">What's up</mnml-card-title>
<mnml-card-content slot="content">
<p>Lorem ipsum blabla.</p>
<p>Mimimi lorem ipsum ble foo bar:</p>
<ol>
<li>One</li>
<li>Two</li>
<li>Three</li>
</ol>
</mnml-card-content>
<mnml-card-actions slot="actions">
<mnml-button flat>Cancel</mnml-button>
<mnml-button primary>Share</mnml-button>
</mnml-actions>
</mnml-card>
<mnml-card>
<mnml-card-image slot="image" src="http://www.placepuppy.net/400/300" caption="Lorem ipsum"></mnml-card-image>
<mnml-card-content slot="content">
<p>Lorem ipsum blabla.</p>
<p>Mimimi lorem ipsum ble foo bar:</p>
<ol>
<li>One</li>
<li>Two</li>
<li>Three</li>
</ol>
</mnml-card-content>
</mnml-card>
<mnml-card>
<mnml-card-image slot="image" src="http://www.placepuppy.net/400/301" caption="Lorem ipsum"></mnml-card-image>
<mnml-card-content slot="content">
<p>Lorem ipsum blabla.</p>
<p>Mimimi lorem ipsum ble foo bar:</p>
<ol>
<li>One</li>
<li>Two</li>
<li>Three</li>
</ol>
</mnml-card-content>
</mnml-card>
<mnml-card>
<mnml-card-title slot="title">What's up</mnml-card-title>
<mnml-card-image slot="image" src="http://www.placepuppy.net/400/302" caption="Lorem ipsum"></mnml-card-image>
</mnml-card>
<mnml-card>
<mnml-card-image slot="image" src="http://www.placepuppy.net/400/303" caption="Lorem ipsum"></mnml-card-image>
<mnml-card-actions slot="actions">
<mnml-button flat>Cancel</mnml-button>
<mnml-button flat>Share</mnml-button>
</mnml-actions>
</mnml-card>
</div>
</body>
</html>
@ggdaltoso
Copy link

When you do <mnml-card-title slot="title">What's up</mnml-card-title>, to ensure mnml-card-title must be in slot="title", you can set it inside the component itself at connectedCallback:

...
connectedCallback() {
  this.setAttribute('slot', 'title');
}
... 

and then, just use <mnml-card-title>What's up</mnml-card-title>

@andreloureiro
Copy link
Author

@ggdaltoso Amazing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment