Created
April 26, 2020 07:31
-
-
Save crummy/84ce7fbcbe0055bb8c1682424abbef18 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script context="module"> | |
let title, message; | |
let warning = false | |
export const error = (m, t) => { | |
message = m | |
title = t | |
warning = true | |
console.log(message) | |
} | |
export const info = (m, t) => { | |
message = m | |
title = t | |
warning = false | |
} | |
</script> | |
{#if message} | |
<div id="message" class:warning={warning}> | |
{#if title} | |
<div id="title">{title}</div> | |
{/if} | |
{message} | |
</div> | |
{/if} | |
<style> | |
#message { | |
background-color: lightblue; | |
padding: 1em; | |
margin: 1em; | |
} | |
.warning { | |
background-color: orangered !important; | |
} | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment