-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from fnune/buttons
Implement an MVP for primary and secondary buttons
- Loading branch information
Showing
9 changed files
with
157 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import { configure } from '@storybook/html' | ||
|
||
import '../scss/janina.scss' | ||
import '../stories/theme.scss' | ||
|
||
configure(require.context('../stories', true, /\.stories\.ts/), module) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
@charset "utf-8"; | ||
|
||
@import 'button'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
@use '../base/palette'; | ||
|
||
$primary: $blue; | ||
$primary-tint: $blue-tint; | ||
$primary-shade: $blue-shade; | ||
|
||
.button { | ||
display: inline-block; | ||
|
||
white-space: nowrap; | ||
cursor: pointer; | ||
outline: none; | ||
|
||
height: 40px; | ||
line-height: 40px; | ||
font-size: 15px; | ||
padding: 0 14px; | ||
border: none; | ||
|
||
border-radius: 4px; | ||
letter-spacing: 0.04em; | ||
font-weight: bold; | ||
|
||
box-shadow: 0 7px 14px rgba(50, 50, 93, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08); | ||
|
||
transform: translateY(0); | ||
transition: all 0.2s ease; | ||
|
||
&:hover { | ||
transform: translateY(-1px); | ||
box-shadow: 0 10px 18px rgba(50, 50, 93, 0.1), 0 4px 6px rgba(0, 0, 0, 0.08); | ||
} | ||
|
||
&:active { | ||
transform: translateY(1px); | ||
} | ||
|
||
&.primary { | ||
color: $white; | ||
text-shadow: 0 1px 3px rgba($primary-shade, 0.4); | ||
|
||
background: linear-gradient(60deg, $primary-shade 0%, $primary 50%, $primary-tint 100%); | ||
background-size: 200% 40px; | ||
background-position: 0 0; | ||
|
||
&:hover { | ||
background-position: 100% -100%; | ||
} | ||
|
||
&:active { | ||
color: $light-tint; | ||
} | ||
} | ||
|
||
&.secondary { | ||
color: $primary; | ||
text-shadow: 0 1px 6px rgba($primary-tint, 0.4); | ||
background-color: $white; | ||
|
||
&:hover { | ||
color: $primary-tint; | ||
} | ||
|
||
&:active { | ||
color: $primary-shade; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.buttons { | ||
display: flex; | ||
height: 80vh; | ||
width: 100%; | ||
align-items: center; | ||
justify-content: center; | ||
|
||
> * + * { | ||
margin-left: 24px; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import './button.stories.scss' | ||
|
||
export default { | ||
title: 'Button', | ||
} | ||
|
||
export const button = () => ` | ||
<div class="buttons"> | ||
<button class="button primary">Make a reservation</button> | ||
<button class="button secondary">Find more hotels</button> | ||
</div> | ||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
html { | ||
font-family: 'Inter', sans-serif; | ||
} |