chore: run prettier for svelte files (#2071)

This commit is contained in:
Daniel Kantor 2022-03-15 08:38:42 +01:00 committed by GitHub
parent 4ea85181da
commit 771909601b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 81 additions and 59 deletions

View File

View File

@ -15,8 +15,20 @@
export let disabled = false
</script>
<div class="lluis-button" class:small={size === "small"} class:large={size === "large"} data-style={style}>
<LinkOrButton href={href} on:click="{() => dispatch('click')}" type={type} target={target} tabIndex={tabIndex} disabled={disabled}>
<div
class="lluis-button"
class:small={size === "small"}
class:large={size === "large"}
data-style={style}
>
<LinkOrButton
{href}
on:click={() => dispatch("click")}
{type}
{target}
{tabIndex}
{disabled}
>
{#if loading}
<span class="spinner">
<Icon icon="spinner" />
@ -33,34 +45,37 @@
<style type="text/scss">
@keyframes spinner {
to {transform: rotate(360deg);}
to {
transform: rotate(360deg);
}
}
.lluis-button {
display: inline-block;
}
div>:global(*) {
div > :global(*) {
display: flex;
border-radius: var(--button-radius-small);
padding: 6px 20px;
margin: 4px;
transition-property: filter;
transition-duration: .1s;
transition-duration: 0.1s;
transition-timing-function: ease-in-out;
:global(.icon) {
width: unset;
height: unset;
margin-right: 8px;
}
:global(.icon) {
width: unset;
height: unset;
margin-right: 8px;
}
&:hover, &:focus {
&:hover,
&:focus {
filter: brightness(1.2);
}
&:active {
filter: brightness(.9);
filter: brightness(0.9);
transform: scale(0.9);
}
}
@ -71,7 +86,7 @@
height: 16px;
align-items: center;
justify-content: center;
animation: spinner .6s linear infinite;
animation: spinner 0.6s linear infinite;
:global(.icon) {
display: block;
@ -79,19 +94,21 @@
}
}
div[data-style=primary]>:global(*) {
div[data-style="primary"] > :global(*) {
border: 1px solid var(--button-primary-border);
color: var(--button-primary-text-color) !important; /* TODO: remove when hero is remoevd */
color: var(
--button-primary-text-color
) !important; /* TODO: remove when hero is remoevd */
background-color: var(--button-primary-background-color) !important;
}
div[data-style=secondary]>:global(*) {
div[data-style="secondary"] > :global(*) {
border: 1px solid var(--button-secondary-border);
color: var(--button-secondary-text-color) !important;
background-color: var(--button-secondary-background-color) !important;
}
div[data-style=key]>:global(*) {
div[data-style="key"] > :global(*) {
margin: 6px;
padding: 6px 0;
text-align: center;
@ -101,17 +118,17 @@
background-color: var(--button-key-background-color) !important;
}
.small>:global(*) {
.small > :global(*) {
font-size: 16px;
padding: 3px 12px;
}
.medium>:global(*) {
.medium > :global(*) {
font-size: 18px;
padding: 3px 12px;
}
.large>:global(*) {
.large > :global(*) {
font-size: 20px;
padding: 9px 14px;
}

View File

@ -7,16 +7,17 @@
</script>
<div
data-size="{size}"
data-size-desktop="{sizeDesktop}"
data-size-tablet="{sizeTablet}"
class:is-one-third-desktop="{sizeDesktop === '1/3'}"
class:is-half-tablet="{sizeTablet === '1/2'}"
class:is-one-third-tablet="{sizeTablet === '1/3'}"
class:is-one-quarter="{size === '1/4'}"
class:is-one-third="{size === '1/3'}"
class:is-three-fifths="{size === '3/5'}"
class:is-1="{size === '1'}"
class="column">
data-size={size}
data-size-desktop={sizeDesktop}
data-size-tablet={sizeTablet}
class:is-one-third-desktop={sizeDesktop === "1/3"}
class:is-half-tablet={sizeTablet === "1/2"}
class:is-one-third-tablet={sizeTablet === "1/3"}
class:is-one-quarter={size === "1/4"}
class:is-one-third={size === "1/3"}
class:is-three-fifths={size === "3/5"}
class:is-1={size === "1"}
class="column"
>
<slot />
</div>

View File

@ -5,13 +5,14 @@
<div
class="columns"
class:is-multiline="{multiline}"
class:is-reversed="{reversed}">
class:is-multiline={multiline}
class:is-reversed={reversed}
>
<slot />
</div>
<style type="text/scss">
@import './node_modules/bulma/sass/utilities/_all';
@import "./node_modules/bulma/sass/utilities/_all";
@include until($tablet) {
.is-reversed {

View File

@ -1,15 +1,15 @@
<script lang="typescript">
import Icon from "lluis/Icon.svelte";
import Icon from "lluis/Icon.svelte"
export let name: string;
export let id: string;
export let icon: string;
export let type = "text";
export let value: string | boolean | number;
export let formStatus = {};
let error = null;
export let name: string
export let id: string
export let icon: string
export let type = "text"
export let value: string | boolean | number
export let formStatus = {}
let error = null
$: {
error = formStatus[id];
error = formStatus[id]
}
</script>

View File

@ -2,7 +2,6 @@
<slot />
</div>
<style>
div {
display: none !important;

View File

@ -5,6 +5,6 @@
export let left = false
</script>
<span class="{`icon is-${size}`}" class:is-left="{left}">
<i class="{`${prefix} fa-${icon} ${size === 'large' ? 'fa-2x' : ''}`}"></i>
<span class={`icon is-${size}`} class:is-left={left}>
<i class={`${prefix} fa-${icon} ${size === "large" ? "fa-2x" : ""}`} />
</span>

View File

@ -4,7 +4,7 @@
</script>
<a href="/" class="logo">
<img src={src} alt={alt}/>
<img {src} {alt} />
</a>
<style type="text/scss">

View File

@ -42,11 +42,11 @@
max-width: 960px;
margin: auto;
:global( [slot="left"] ) {
:global([slot="left"]) {
flex-grow: 1;
}
:global( [slot="right"] ) {
:global([slot="right"]) {
flex-grow: 0;
}
}

View File

@ -14,17 +14,18 @@
<h1
class:title={!isSubtitle}
class:subtitle={isSubtitle}
class="{`is-size-${size}
${sizeMobile ? `is-size-${sizeMobile}-mobile` : '' }
${sizeTablet ? `is-size-${sizeTablet}-tablet` : ''}
${sizeDesktop ? `is-size-${sizeDesktop}-desktop` : ''}
${textWeight? `has-text-weight-${textWeight}` : '' }
${align? `has-text-${align}` : '' }`}"
class:is-spaced={isSpaced}>
class={`is-size-${size}
${sizeMobile ? `is-size-${sizeMobile}-mobile` : ""}
${sizeTablet ? `is-size-${sizeTablet}-tablet` : ""}
${sizeDesktop ? `is-size-${sizeDesktop}-desktop` : ""}
${textWeight ? `has-text-weight-${textWeight}` : ""}
${align ? `has-text-${align}` : ""}`}
class:is-spaced={isSpaced}
>
<slot />
</h1>
<style type="text/scss">
@import './node_modules/bulma/sass/utilities/_all';
@import "./node_modules/bulma/sass/utilities/_all";
@import "./node_modules/bulma/sass/elements/title.sass";
</style>

View File

@ -11,8 +11,8 @@
"test:ci": "yarn web test:ci",
"web": "yarn workspace @librelingo/web",
"types": "yarn workspaces run types",
"format": "eslint . --fix --max-warnings=0",
"lint": "eslint . --max-warnings=0",
"format": "eslint . --fix --max-warnings=0 && prettier --write apps/**/*.svelte --ignore-path ./.prettierignore_for_svelte",
"lint": "eslint . --max-warnings=0 && prettier --check apps/**/*.svelte --ignore-path ./.prettierignore_for_svelte",
"exportAllCourses": "./scripts/exportAllYamlCourses.sh",
"exportCourse": "./scripts/exportYamlCourse.sh",
"docs": "poetry run mkdocs serve",

3
prettier.config.js Normal file
View File

@ -0,0 +1,3 @@
module.exports = {
semi: false,
}