Skip to content

Commit

Permalink
Merge pull request #453 from MuckRock/sveltekit-style-reset
Browse files Browse the repository at this point in the history
sveltekit style reset
  • Loading branch information
eyeseast authored Feb 23, 2024
2 parents 9dcac46 + aca4d26 commit c1c5d8d
Show file tree
Hide file tree
Showing 15 changed files with 78 additions and 28 deletions.
3 changes: 1 addition & 2 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ import type { Preview } from "@storybook/svelte";
import { initialize, mswLoader } from "msw-storybook-addon";
import { mockDateDecorator } from "storybook-mock-date-decorator";

import "@/style/kit.css";
import "../src/lib/i18n/index.js";
import "../src/style/variables.css";
import "../src/style/global.css";

// Initialize MSW
initialize({
Expand Down
18 changes: 7 additions & 11 deletions src/lib/components/common/KV.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,21 @@
gap: 0.625rem;
border-radius: 0.25rem;
border: 1px solid #b5ceed;
background: #eef3f9;
border: 1px solid var(--color-blue-gray, #b5ceed);
background: var(--color-gray-light, #eef3f9);
}
.key {
color: rgba(21, 51, 89, 0.6);
font-family: "Source Sans Pro";
font-size: 0.625rem;
.key,
.value {
color: var(--color-blue-dark, rgba(21, 51, 89, 0.6));
font-size: var(--font-size-tiny, 0.625rem);
font-style: italic;
font-weight: 400;
line-height: normal;
}
.value {
color: #153359;
font-family: "Source Sans Pro";
font-size: 0.625rem;
color: var(--color-blue-dark, #153359);
font-style: normal;
font-weight: 400;
line-height: normal;
}
</style>
18 changes: 7 additions & 11 deletions src/lib/components/documents/DocumentListItem.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ It's deliberately minimal and can be wrapped in other components to add addition
.thumbnail {
border-radius: 0.125rem;
border: 1px solid #cbcbcb;
background: #fff;
border: 1px solid var(--color-gray-light, #cbcbcb);
background: var(--color-white, #fff);
box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.1);
}
Expand All @@ -98,26 +98,23 @@ It's deliberately minimal and can be wrapped in other components to add addition
}
h4 {
color: #000;
font-family: "Source Sans Pro";
color: var(--color-black, #000);
font-size: 1rem;
font-style: normal;
font-weight: 600;
line-height: normal;
}
.meta {
color: rgba(0, 0, 0, 0.6);
font-family: "Source Sans Pro";
color: var(--color-gray, rgba(0, 0, 0, 0.6));
font-size: 0.75rem;
font-style: normal;
font-weight: 400;
line-height: normal;
}
.description {
color: #000;
font-family: "Source Sans Pro";
color: var(--color-black, #000);
font-size: 0.75rem;
font-style: normal;
font-weight: 400;
Expand All @@ -137,10 +134,9 @@ It's deliberately minimal and can be wrapped in other components to add addition
.open {
overflow: hidden;
color: var(--primary, #4294f0);
color: var(--color-primary, #4294f0);
text-overflow: ellipsis;
font-family: "Source Sans Pro";
font-size: 0.75rem;
font-size: var(--font-size-small, 0.75rem);
font-style: normal;
font-weight: 700;
line-height: normal;
Expand Down
6 changes: 6 additions & 0 deletions src/routes/(embed)/+layout.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<script>
import "@/style/variables.css";
import "@/style/global.css";
</script>

<slot />
6 changes: 6 additions & 0 deletions src/routes/(pages)/+layout.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<script>
import "@/style/variables.css";
import "@/style/global.css";
</script>

<slot />
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 1 addition & 3 deletions src/routes/+layout.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<script lang="ts">
// todo: find a better long-term home for styles
import "../style/variables.css";
import "../style/global.css";
import "@/style/kit.css";
import type { LayoutData } from "./$types";
import type { User } from "@/api/types/orgAndUser.d.ts";
Expand Down
4 changes: 4 additions & 0 deletions src/routes/stories/note-embed.stories.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<script context="module">
// legacy css
import "@/style/variables.css";
import "@/style/global.css";
import { Story } from "@storybook/addon-svelte-csf";
import NoteEmbed from "../(embed)/documents/[id]/annotations/[note_id]/+page.svelte";
Expand Down
4 changes: 4 additions & 0 deletions src/routes/stories/page-embed.stories.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<script context="module">
// legacy css
import "@/style/variables.css";
import "@/style/global.css";
import { Story } from "@storybook/addon-svelte-csf";
import PageEmbed from "../(embed)/documents/[id]/pages/[page]/+page.svelte";
Expand Down
4 changes: 4 additions & 0 deletions src/routes/stories/project-embed.stories.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<script context="module">
// legacy css
import "@/style/variables.css";
import "@/style/global.css";
import { Story } from "@storybook/addon-svelte-csf";
import ProjectEmbed from "../(embed)/projects/[project_id]/+page.svelte";
Expand Down
37 changes: 37 additions & 0 deletions src/style/kit.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
Updated variables and styles for new SvelteKit routes
*/

:root {
/* fonts */
--font-sans: "Source Sans Pro";
--font-size-tiny: 0.625rem;
--font-size-small: 0.75rem;
--font-size-normal: 1rem;
--font-size-large: 1.25rem;
--font-size-largest: 1.5rem;

/* colors */
--color-black: #000;
--color-white: #fff;

--color-gray-light: #eef3f9;
--color-gray: #555555;
--color-gray-dark: #153359;

--color-yellow: #ffe325;
--color-green: #93e48f;
--color-green-shiny: #24cc99;
--color-blue: #4294f0;
--color-blue-light: #ff785c;
--color-blue-dark: #1e508c;
--color-blue-gray: #b5ceed;
--color-purple: #5c1e8c;

/* semantic aliases */
--color-primary: var(--color-blue);
--color-premium: var(--color-green-shiny);
--color-note-public: var(--color-yellow);
--color-note-private: var(--color-blue-light);
--color-note-org: var(--color-green);
}
2 changes: 1 addition & 1 deletion src/style/variables.css
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@

--sidebarStickyZ: 9;
--appStickyZ: 10;

--toastOuterZ: 11;
--sidebarZ: 12;
--hamburgerZ: 13;
Expand Down

0 comments on commit c1c5d8d

Please sign in to comment.