Skip to content

Commit

Permalink
docs: updated installation section
Browse files Browse the repository at this point in the history
fix: removed unused packages
fix: added basic typography
fix: removed tailwind typography from everywhere
  • Loading branch information
Craig Howell committed Oct 8, 2022
1 parent e45871d commit 7faf266
Show file tree
Hide file tree
Showing 15 changed files with 45 additions and 111 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ A showcase can be found at `https://stwui.vercel.app/`. Documentation is still f
module.exports = {
content: ['./src/**/*.{html,js,svelte,ts}'],
plugins: [
require('@tailwindcss/forms'),
require('stwui/plugin')
],
darkMode: 'class'
Expand Down
69 changes: 0 additions & 69 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@
"@sveltejs/adapter-vercel": "next",
"@sveltejs/kit": "next",
"@sveltejs/package": "1.0.0-next.5",
"@tailwindcss/aspect-ratio": "^0.4.2",
"@tailwindcss/forms": "^0.5.3",
"@tailwindcss/typography": "^0.5.7",
"@types/cookie": "^0.5.1",
"@typescript-eslint/eslint-plugin": "^5.38.0",
"@typescript-eslint/parser": "^5.38.0",
Expand Down
6 changes: 3 additions & 3 deletions src/lib/components/list/Title.svelte
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<script lang="ts">
import { twMerge } from 'tailwind-merge';
const defaultClass = 'text-sm font-medium text-light-content dark:text-dark-content';
const defaultClass = 'text-sm font-semibold text-light-content dark:text-dark-content';
const finalClass = twMerge(defaultClass, $$props.class);
</script>

<p class={finalClass}>
<h3 class={finalClass}>
<slot />
</p>
</h3>
5 changes: 1 addition & 4 deletions src/lib/components/menu/Item.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@
}
</script>

<div
class="prose max-w-full transition-all duration-300"
style="width: {$menuCollapse ? '3rem' : '100%'}"
>
<div class="transition-all duration-300" style="width: {$menuCollapse ? '3rem' : '100%'}">
<a
on:click
use:tooltip={{
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/post/Content.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
});
const defaultClass =
'prose max-w-full text-light-content dark:text-dark-content first:rounded-t-md last:rounded-b-md px-2 py-3 sm:px-6';
'text-light-content dark:text-dark-content first:rounded-t-md last:rounded-b-md px-2 py-3 sm:px-6';
const finalClass = twMerge(defaultClass, $$props.class);
</script>

Expand Down
3 changes: 1 addition & 2 deletions src/lib/components/post/Created.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
component: 'Post.Header.Created'
});
const defaultClass =
'prose max-w-full text-xs text-light-secondary-content dark:text-dark-secondary-content';
const defaultClass = 'text-xs text-light-secondary-content dark:text-dark-secondary-content';
const finalClass = twMerge(defaultClass, $$props.class);
</script>

Expand Down
4 changes: 2 additions & 2 deletions src/lib/components/post/Creator.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { twMerge } from 'tailwind-merge';
import { useContext } from '$lib/utils/useContext';
import { useContext } from '../../utils/useContext';
import { POST_HEADER_CONTEXT_ID } from './Header.svelte';
useContext({
Expand All @@ -9,7 +9,7 @@
component: 'Post.Header.Created'
});
const defaultClass = 'prose max-w-full text-md text-light-content dark:text-dark-content';
const defaultClass = 'text-md font-semibold text-light-content dark:text-dark-content';
const finalClass = twMerge(defaultClass, $$props.class);
</script>

Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/statistic/Statistic.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import { twMerge } from 'tailwind-merge';
const defaultClass =
'prose max-w-full overflow-hidden rounded-md px-4 py-5 shadow-md dark:shadow-black sm:p-5 bg-light-surface dark:bg-dark-surface';
'overflow-hidden rounded-md px-4 py-5 shadow-md dark:shadow-black sm:p-5 bg-light-surface dark:bg-dark-surface';
const finalClass = twMerge(defaultClass, $$props.class);
</script>

Expand Down
19 changes: 19 additions & 0 deletions src/lib/plugin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,25 @@ module.exports = plugin(
}
});
addBase({
h1: {
'font-weight': '800',
'font-size': '2.25em',
'line-height': '1.1111111'
},
h2: {
'font-weight': '700',
'font-size': '1.5em',
'line-height': '1.3333333'
},
h3: {
'font-weight': '600',
'font-size': '1.25em',
'line-height': '1.6'
},
h4: {
'font-weight': '600',
'line-height': '1.5'
},
"[type='text']:focus": {
outline: 'unset',
'outline-offset': 'unset',
Expand Down
6 changes: 3 additions & 3 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@
<Row class="h-[500px]">
<Col class="md:col-12 col-24 h-full">
<div
class="prose max-w-full p-4 md:p-8 min-h-[500px] h-[calc(100vh-200px)] flex flex-col justify-center items-start"
class="p-4 md:p-8 min-h-[500px] h-[calc(100vh-200px)] flex flex-col justify-center items-start"
>
<h1 class="mb-0 text-6xl text-primary">Components you want</h1>
<h1 class="mb-0 text-6xl text-light-content dark:text-dark-content">
<h1 class="mb-0 text-6xl font-extrabold text-primary">Components you want</h1>
<h1 class="mb-0 text-6xl font-extrabold text-light-content dark:text-dark-content">
the way you want them
</h1>
<p class="text-light-content dark:text-dark-content mt-4">
Expand Down
2 changes: 1 addition & 1 deletion src/routes/alert/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<Alert.Icon slot="icon">
<Icon icon="cancel" class="text-current" />
</Alert.Icon>
<Alert.Title slot="title"><span>Title</span></Alert.Title>
<Alert.Title slot="title">Title</Alert.Title>
<Alert.Description slot="description">I am a description</Alert.Description>
<Button
slot="extra"
Expand Down
2 changes: 1 addition & 1 deletion src/routes/alert/examples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const example = `
<Alert.Icon slot="icon">
<Icon icon="cancel" class="text-current" />
</Alert.Icon>
<Alert.Title slot="title"><span>Title</span></Alert.Title>
<Alert.Title slot="title">Title</Alert.Title>
<Alert.Description slot="description">I am a description</Alert.Description>
<Button
slot="extra"
Expand Down
26 changes: 10 additions & 16 deletions src/routes/installation/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
module.exports = {
content: ['./src/**/*.{html,js,svelte,ts}'],
plugins: [
require('@tailwindcss/typography'),
require('@tailwindcss/aspect-ratio'),
require('@tailwindcss/forms'),
require('stwui/plugin')
],
Expand All @@ -18,25 +16,21 @@ module.exports = {
</script>

<div class="p-12 w-full h-full overflow-auto">
<article class="prose w-full max-w-full">
<h1 class="text-light-content dark:text-dark-content mb-0">Installation</h1>
<Divider />
<h1 class="text-light-content dark:text-dark-content mb-0">Installation</h1>
<Divider />

<p class="mb-3 mt-5 text-light-content dark:text-dark-content">
Run the following command to add STWUI to your project:
</p>
</article>
<p class="mb-3 mt-5 text-light-content dark:text-dark-content">
Run the following command to add STWUI to your project:
</p>

<CodeBlock language="bash" code={installCode} />

<article class="prose w-full max-w-full">
<h1 class="text-light-content dark:text-dark-content mb-0 mt-12">Configure TailwindCSS</h1>
<Divider />
<h1 class="text-light-content dark:text-dark-content mb-0 mt-12">Configure TailwindCSS</h1>
<Divider />

<p class="mb-3 mt-5 text-light-content dark:text-dark-content">
Modify your tailwind.config.cjs file with the following:
</p>
</article>
<p class="mb-3 mt-5 text-light-content dark:text-dark-content">
Modify your tailwind.config.cjs file with the following:
</p>

<CodeBlock language="javascript" code={tailwindCode} />
</div>
7 changes: 1 addition & 6 deletions tailwind.config.cjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
module.exports = {
mode: 'jit',
content: ['./src/**/*.{html,js,svelte,ts}'],
plugins: [
require('@tailwindcss/typography'),
require('@tailwindcss/aspect-ratio'),
require('@tailwindcss/forms'),
require('./src/lib/plugin')
],
plugins: [require('@tailwindcss/forms'), require('./src/lib/plugin')],
'headwind.runOnSave': true,
darkMode: 'class',
theme: {
Expand Down

0 comments on commit 7faf266

Please sign in to comment.