-
-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(CSS): project wide refactoring and cleanup #146
Draft
unseen-ninja
wants to merge
10
commits into
main
Choose a base branch
from
refactor/css
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
9f1061f
refactor(button): turn buttons into components
unseen-ninja cd0e9f3
refactor(button): no more state rune
unseen-ninja 7debc8e
refactor(CSS): landing page stuff
unseen-ninja 2c86406
refactor(CSS): add new utils
unseen-ninja 6fae6e6
chore: pull latest changes from main
unseen-ninja 0589ec3
refactor(CSS): split and remove global _scaffolding.scss
unseen-ninja 55a51fc
refactor(CSS): global content grid
unseen-ninja ef2da56
refactor(CSS): use new utils globally
unseen-ninja 36e180c
fix(CSS): fully smooth accent bar
unseen-ninja 06a184f
chore: no more deprecated SASS
unseen-ninja File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -0,0 +1,148 @@ | ||
<script lang="ts"> | ||
|
||
import type { Snippet } from "svelte"; | ||
import { phosphorIcon } from "@data/icons"; | ||
import Icon from "@iconify/svelte"; | ||
|
||
|
||
interface Props { | ||
children: Snippet; | ||
style?: 'mauve' | 'peach' | 'blue' | 'green' | 'transparent'; | ||
small?: boolean; | ||
phIconName?: string; | ||
disabled?: boolean; | ||
} | ||
|
||
let { children, style, small, phIconName, disabled }: Props = $props(); | ||
|
||
|
||
let phIcon = $state({ | ||
sgoudham marked this conversation as resolved.
Show resolved
Hide resolved
|
||
body: "", | ||
width: 0, | ||
height: 0 | ||
}); | ||
|
||
let phIconSize = $state(24); | ||
sgoudham marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
if (phIconName != null) phIcon = phosphorIcon(phIconName); | ||
if (small) phIconSize = 16; | ||
|
||
|
||
</script> | ||
|
||
|
||
|
||
<button {disabled} | ||
class=" | ||
btn | ||
{style == null ? 'btn-default' : ''} | ||
{style == 'mauve' ? 'btn-mauve' : ''} | ||
{style == 'peach' ? 'btn-peach' : ''} | ||
{style == 'green' ? 'btn-green' : ''} | ||
{style == 'blue' ? 'btn-blue' : ''} | ||
{style == 'transparent' ? 'btn-transparent' : ''} | ||
{phIconName != null ? 'btn-has-icon' : ''} | ||
{small ? 'btn-small' : ''} | ||
" | ||
> | ||
{#if phIconName != null} | ||
<Icon | ||
width={phIconSize} | ||
height={phIconSize} | ||
icon={{ | ||
body: phIcon.body, | ||
width: phIcon.width, | ||
height: phIcon.height, | ||
}} | ||
/> | ||
{/if} | ||
{@render children()} | ||
</button> | ||
|
||
|
||
|
||
<style lang="scss"> | ||
|
||
@use "../styles/utils"; | ||
|
||
:global(.btn-group) { | ||
display: flex; | ||
gap: var(--space-xs); | ||
flex-wrap: wrap; | ||
} | ||
|
||
.btn { | ||
@include utils.containerPadding(xs-y); | ||
|
||
border-radius: 9999px; | ||
border: none; | ||
background-color: var(--surface0); | ||
|
||
font-size: 1.6rem; | ||
font-weight: 500; | ||
color: var(--text); | ||
|
||
transition: all 350ms ease-in-out; | ||
cursor: pointer; | ||
|
||
&-small { | ||
@include utils.containerPadding(xxs); | ||
border-radius: var(--border-radius-normal); | ||
} | ||
|
||
&-transparent { | ||
background-color: transparent; | ||
} | ||
|
||
&-transparent:hover, | ||
&-transparent:focus { | ||
background-color: color-mix(in srgb, transparent, var(--text) 10%); | ||
} | ||
|
||
&-has-icon { | ||
display: flex; | ||
align-items: center; | ||
gap: var(--space-xs); | ||
} | ||
|
||
&-peach, | ||
&-mauve, | ||
&-green, | ||
&-blue { | ||
background-size: 150% 100%; | ||
background-position: top left; | ||
font-weight: 600; | ||
color: var(--inverted-text); | ||
|
||
&:hover, | ||
&:focus { | ||
background-position: top right; | ||
} | ||
} | ||
|
||
&-peach { | ||
background-color: var(--peach); | ||
background-image: linear-gradient(120deg, var(--peach), var(--red)); | ||
} | ||
|
||
&-mauve { | ||
background-color: var(--mauve); | ||
background-image: linear-gradient(120deg, var(--pink), var(--mauve)); | ||
} | ||
|
||
&-green { | ||
background-color: var(--green); | ||
background-image: linear-gradient(120deg, var(--teal), var(--green)); | ||
} | ||
|
||
&-blue { | ||
background-color: var(--blue); | ||
background-image: linear-gradient(120deg, var(--blue), var(--sky)); | ||
} | ||
} | ||
|
||
.btn { | ||
transition: background-position 350ms ease-in-out; | ||
} | ||
|
||
</style> |
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
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
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
This file was deleted.
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 |
---|---|---|
|
@@ -4,4 +4,3 @@ | |
@use "./scaffolding"; | ||
|
||
@use "./tables"; | ||
@use "./buttons"; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of taking in
small
, it'll be better to take in an explicitwidth
andheight
. We could default those to some number if we want.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small
applies to the button size in general, not just the icon size. I don't think we want to use fixed dimensions for buttons?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In that case, we should have an enum called
ButtonSize
or equivalent that can either besmall
ordefault
.