Skip to content

Commit

Permalink
feat: shadow
Browse files Browse the repository at this point in the history
  • Loading branch information
punchanabu committed Sep 7, 2024
1 parent f7427d8 commit 64cd649
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
15 changes: 15 additions & 0 deletions src/lib/components/Playground.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,21 @@
</div>
{/each}
</section>

<section class="section">
<h2 class="font-bold text-2xl mb-4">Button Shadow</h2>
<button class="shadow-button-shadow p-4 bg-white text-black rounded">
Button with Shadow
</button>
</section>

<!-- Card Shadow Test -->
<section class="section">
<h2 class="font-bold text-2xl mb-4">Card Shadow (Hover)</h2>
<div class="p-6 bg-white text-black rounded shadow-card-shadow hover:shadow-card-shadow-hover transition-shadow">
Card with hover shadow
</div>
</section>
</div>

<style>
Expand Down
6 changes: 6 additions & 0 deletions src/styles/tailwind/shadow.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export const boxShadow = {
'button-shadow': '0px 4px 12px 0px rgba(0, 0, 0, 0.15)',
'card-shadow': '0px 8px 24px 0px rgba(0, 0, 0, 0.15) ',
// we cannot specify the hover: state directly on box shadow
'card-shadow-hover': '0px 8px 24px 0px rgba(0, 0, 0, 0.25)',
}
5 changes: 3 additions & 2 deletions tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
/** @type {import('tailwindcss').Config} */
import { colorScheme } from './src/styles/tailwind/color';

import { boxShadow } from './src/styles/tailwind/shadow';
export default {
content: ['./src/**/*.{html,js,svelte,ts}'],
theme: {
extend: {
colors: colorScheme
colors: colorScheme,
boxShadow: boxShadow
}
},
plugins: []
Expand Down

0 comments on commit 64cd649

Please sign in to comment.