Skip to content

Commit

Permalink
Merge pull request #11 from twm/css-cleanup
Browse files Browse the repository at this point in the history
CSS cleanup
  • Loading branch information
twm authored Oct 30, 2024
2 parents e2dcfcf + 5cdffd5 commit da38541
Show file tree
Hide file tree
Showing 11 changed files with 67 additions and 42 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ permissions:

jobs:
Fast:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -39,7 +39,7 @@ jobs:
path: build

Slow:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs: [Fast]
steps:
- uses: actions/checkout@v4
Expand All @@ -66,7 +66,7 @@ jobs:
path: playwright-report

Publish:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs: [Fast]
if: ${{ !cancelled() && github.ref == 'refs/heads/trunk' }}

Expand Down
6 changes: 4 additions & 2 deletions src/lib/Form.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@
.outputs {
display: grid;
grid-template-columns: 1fr 12rem;
grid-auto-rows: minmax(2rem, auto);
gap: 0.5rem;
align-items: baseline;
}
select {
Expand All @@ -74,8 +76,8 @@
background: inherit;
color: inherit;
border: none;
border-bottom: 1px solid currentColor;
padding: 1px 4px;
border-bottom: 2px solid var(--rule-color);
padding: 0 2px;
line-height: 1;
}
</style>
8 changes: 4 additions & 4 deletions src/lib/FracInput.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@
background: inherit;
color: inherit;
border: none;
border-bottom: 1px solid currentColor;
padding: 0;
border-bottom: 2px solid var(--rule-color);
padding: 0 2px;
line-height: 1;
}
:invalid {
border-bottom-color: red;
input:invalid {
border-bottom-color: var(--invalid-color);
}
</style>
4 changes: 4 additions & 0 deletions src/lib/FracRange.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
grid-template-columns: 3rem 1fr;
}
output {
padding: 0 2px;
}
input {
width: 100%;
box-sizing: border-box;
Expand Down
14 changes: 10 additions & 4 deletions src/lib/PartList.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,18 @@
width: 100%;
height: auto;
}
th {
text-align: left;
border-bottom: 1px solid gray;
table {
border-spacing: 0;
}
th,
td {
padding-right: 0.5em;
text-align: left;
vertical-align: baseline;
padding: 0.25rem 0.5em 0.25rem 0;
}
thead th {
font-weight: normal;
padding-right: 1rem;
border-bottom: 2px solid var(--rule-color);
}
</style>
34 changes: 34 additions & 0 deletions src/lib/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
@font-face {
font-family: "Zilla Slab";
font-weight: 400;
font-style: normal;
font-stretch: normal;
src: url("$lib/vendor/zilla-slab/ZillaSlab-Regular.woff2") format("woff2");
}
@font-face {
font-family: "Zilla Slab";
font-weight: 700;
font-style: normal;
font-stretch: normal;
src: url("$lib/vendor/zilla-slab/ZillaSlab-Bold.woff2") format("woff2");
}

:root {
--focus-color: #06a8ea;
--invalid-color: red;
--rule-color: #bbb;

font:
400 1rem / 1.15 "Zilla Slab",
"URW Bookman",
serif;
}

:focus-visible {
outline: 2px solid var(--focus-color);
outline-offset: 2px;
}

:is(h1, h2, h3, h4, h5, h6) {
font-weight: normal;
}
25 changes: 2 additions & 23 deletions src/routes/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,32 +1,11 @@
<script>
import normalizeCss from "$lib/vendor/normalize.css/normalize-8.0.1.css?url"
import stylesCss from "$lib/styles.css?url"
</script>

<svelte:head>
<link rel="stylesheet" type="text/css" href={normalizeCss} />
<link rel="stylesheet" type="text/css" href={stylesCss} />
</svelte:head>

<slot></slot>

<style>
@font-face {
font-family: "Zilla Slab";
font-weight: 400;
font-style: normal;
font-stretch: normal;
src: url("$lib/vendor/zilla-slab/ZillaSlab-Regular.woff2") format("woff2");
}
@font-face {
font-family: "Zilla Slab";
font-weight: 700;
font-style: normal;
font-stretch: normal;
src: url("$lib/vendor/zilla-slab/ZillaSlab-Bold.woff2") format("woff2");
}
:global(body) {
font:
400 1rem / 1.2 "Zilla Slab",
"URW Bookman",
serif;
}
</style>
Binary file modified static/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions tests/test.ts-snapshots/calculator-layout-1-Desktop-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions tests/test.ts-snapshots/calculator-layout-1-Phone-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions tests/test.ts-snapshots/calculator-layout-1-Tablet-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit da38541

Please sign in to comment.