Skip to content

Commit

Permalink
feat: embed title as inline svg for easier theming
Browse files Browse the repository at this point in the history
  • Loading branch information
icelam committed Nov 25, 2022
1 parent 8419049 commit 9357a60
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/assets/images/title.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/assets/scss/_colors.scss
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ $color-text-dark: $color-black;
$color-link: rgba($color-white, 0.8);
$color-link-hover: rgba($color-white, 0.9);

// title
$color-title-border: $color-yellow;

// button
$color-button-text: $color-white;
$color-button-default-background: $color-yellow;
Expand Down
8 changes: 8 additions & 0 deletions src/assets/scss/_slot.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,21 @@
margin: $title-margin-top 0 $title-margin-bottom 0;
position: relative;
z-index: $z-index-title; // make sure title on top of sunburst
color: $color-title-border;
display: inline-block;

@each $media-query, $factor in $scale-factors {
@media #{$media-query} {
max-width: $title-width * $factor;
margin: $title-margin-top 0 $title-margin-bottom * $factor 0;
}
}

svg {
width: 100%;
height: auto;
display: block;
}
}

.control-group {
Expand Down
4 changes: 3 additions & 1 deletion src/pages/landing.pug
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ include ../mixins/icons
canvas#confetti-canvas.confetti

#lucky-draw
img.title(src="~@images/title.svg" alt="Lucky Draw")
.title
//- Pug loader currently does not handle webpack alias so we will use relative path here
include ../assets/images/title.svg

.slot
.slot__outer
Expand Down

0 comments on commit 9357a60

Please sign in to comment.