Icon component; header component nearly finished
This commit is contained in:
31
frontend/src/lib/components/service/spacer.svelte
Normal file
31
frontend/src/lib/components/service/spacer.svelte
Normal file
@@ -0,0 +1,31 @@
|
||||
<script>
|
||||
export let type = "left";
|
||||
|
||||
let rule = "";
|
||||
|
||||
if (type == "left") {
|
||||
rule = "margin-left: auto";
|
||||
}
|
||||
if (type == "right") {
|
||||
rule = "margin-right: auto";
|
||||
}
|
||||
if (type == "top") {
|
||||
rule = "margin-top: auto";
|
||||
}
|
||||
if (type == "bottom") {
|
||||
rule = "margin-bottom: auto";
|
||||
}
|
||||
if (type == "vertical") {
|
||||
rule = "margin-top: auto; margin-bottom: auto";
|
||||
}
|
||||
if (type == "horizontal") {
|
||||
rule = "margin-left: auto; margin-right: auto";
|
||||
}
|
||||
|
||||
if (rule == "") {
|
||||
console.error("Invalid spacer type: " + type);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<div class="spacer" style="{rule}"/>
|
||||
Reference in New Issue
Block a user