Skip to content

Commit

Permalink
Merge pull request #750 from alexwlchan/tidy-up-css
Browse files Browse the repository at this point in the history
Continue tidying up the Sass files
  • Loading branch information
alexwlchan authored Apr 5, 2024
2 parents 313add6 + 4c3f854 commit 7a3afa8
Show file tree
Hide file tree
Showing 15 changed files with 72 additions and 86 deletions.
18 changes: 8 additions & 10 deletions src/_includes/nav.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
<nav>
<div id="nav_inner">
<h1><a href="/" aria-label="alex w l chan" aria-braillelabel="alexwlchan">alexwlchan</a></h1>
<h1><a href="/">alexwlchan</a></h1>

<ul class="dot_list">
<li><a href="/">about</a></li>
<li><a href="/writing/">writing</a></li>
<li><a href="/projects/">projects</a></li>
<li><a href="/contact/">contact</a></li>
<li><a href="/atom.xml">rss</a></li>
</ul>
</div>
<ul class="dot_list">
<li><a href="/">about</a></li>
<li><a href="/writing/">writing</a></li>
<li><a href="/projects/">projects</a></li>
<li><a href="/contact/">contact</a></li>
<li><a href="/atom.xml">rss</a></li>
</ul>
</nav>
4 changes: 4 additions & 0 deletions src/_includes/tweet.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
<style type="x-text/scss">
@import "components/tweets.scss";
</style>

{% assign tweet_id = tweet_data["id"] %}
{% assign name = tweet_data["user"]["name"] %}
{% assign screen_name = tweet_data["user"]["screen_name"] %}
Expand Down
1 change: 0 additions & 1 deletion src/_plugins/filter_inline_style.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ def self.get_inline_styles(html, site)
converter = site.find_converter_instance(Jekyll::Converters::Scss)
css = converter.convert(<<~SCSS
@import "mixins.scss";
@import "_settings.scss";
@import "variables.scss";
#{style.text}
Expand Down
27 changes: 0 additions & 27 deletions src/_scss/_main.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
@use "sass:math";

@import "variables.scss";

@import "_settings.scss";
@import "mixins.scss";

h1, h2,
Expand Down Expand Up @@ -46,28 +44,3 @@ a.download {
background: var(--link-hover-background) !important;
}
}

pre, blockquote {
border-color: var(--block-border-color);
background-color: var(--block-background-color);
}

nav {
background: var(--nav-background-url) var(--primary-color-light);
background-size: auto 100%;
}

footer {
background: var(--primary-color-light);
}

@media print {
nav {
background: none;
border-bottom: var(--border-width) solid var(--base-color);
}

#nav_inner {
color: var(--base-color);
}
}
2 changes: 0 additions & 2 deletions src/_scss/_settings.scss

This file was deleted.

8 changes: 0 additions & 8 deletions src/_scss/base/code.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,6 @@ code {
font-size: calc(1em * var(--code-scaling-factor));
}

// Disable selecting the $ or the following space in ``console`` code blocks.
// See https://alexwlchan.net/2021/10/console-copying/
.language-console {
.gp, .gp + .w {
@include disable_select();
}
}

pre {
padding:
calc(2 * var(--default-padding) / 3)
Expand Down
2 changes: 2 additions & 0 deletions src/_scss/base/footer.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
footer {
padding-top: 15px;
padding-bottom: 15px;

background: var(--primary-color-light);
}

#footer_inner {
Expand Down
27 changes: 11 additions & 16 deletions src/_scss/base/layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,19 @@ body {
}
}

main, #footer_inner, #nav_inner, #editing-toolbar_inner {
max-width: var(--max-width);
main, #footer_inner, nav > *, #editing-toolbar_inner {
@include centred(var(--max-width));

padding-left: calc(var(--default-padding) + env(safe-area-inset-left));
padding-right: calc(var(--default-padding) + env(safe-area-inset-right));
}

#nav_inner {
padding-top: calc(1px + env(safe-area-inset-top));
padding-bottom: 1px;
}

#footer_inner {
padding-top: 1px;
padding-bottom: calc(1px + env(safe-area-inset-bottom));
}

img, video, svg, iframe, figure, article, main, #footer_inner, #nav_inner, #editing-toolbar_inner {
img, video, svg, iframe, figure, article {
margin-left: auto;
margin-right: auto;
}
Expand All @@ -48,7 +44,12 @@ figcaption {
margin-top: 8px;
}

pre, blockquote, img.screenshot, a.download {
pre, blockquote {
border: var(--border-width) var(--border-style) var(--block-border-color);
background-color: var(--block-background-color);
}

img.screenshot, a.download {
border-radius: var(--border-radius);
border-style: var(--border-style);
border-width: var(--border-width);
Expand Down Expand Up @@ -84,10 +85,8 @@ article, main {
}
}



img.screenshot {
border-color: #f0f0f0;
border-color: var(--border-width) var(--border-style) var(--screenshot-border-color);
}

.post_cards .card {
Expand All @@ -104,10 +103,6 @@ img.screenshot {
background-image: url('/theme/black-waves-transparent.png');
}

img.screenshot {
border-color: #3f3f3f;
}

.post_cards .card {
background: #0d0d0d;
}
Expand Down
18 changes: 0 additions & 18 deletions src/_scss/base/nav.scss

This file was deleted.

2 changes: 1 addition & 1 deletion src/_scss/base/text.scss
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ sup {
border: 0 !important;
}

#footer_inner, #nav_inner {
#footer_inner {
color: white;

a, a:visited {
Expand Down
32 changes: 32 additions & 0 deletions src/_scss/components/nav.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
nav {
background: var(--nav-background-url) var(--primary-color-light);
background-size: auto 100%;

color: white;

a, a:visited {
@include link_styles(white, 0.5);
}

h1 {
padding-top: calc(1px + env(safe-area-inset-top));
margin-bottom: -5px;
font-size: 1.7em;

a {
text-decoration: none;
}
}

ul {
padding: 0;
padding-bottom: 1px;
margin-bottom: 10px;
}

@media print {
background: none;
border-bottom: var(--border-width) solid var(--primary-color-light);
color: var(--primary-color-light);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -186,3 +186,11 @@ pre {
}
}
}

// Disable selecting the $ or the following space in ``console`` code blocks.
// See https://alexwlchan.net/2021/10/console-copying/
.language-console {
.gp, .gp + .w {
@include disable_select();
}
}
File renamed without changes.
4 changes: 4 additions & 0 deletions src/_scss/variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ $accent-grey-dark: #999;

--accent-grey: #{$accent-grey-light};
--accent-grey-link-hover: #{rgba($accent-grey-light, 0.2)};

--screenshot-border-color: #f0f0f0;
}

@media (prefers-color-scheme: dark) {
Expand All @@ -49,6 +51,8 @@ $accent-grey-dark: #999;

--accent-grey: #{$accent-grey-dark};
--accent-grey-link-hover: #{rgba($accent-grey-dark, 0.2)};

--screenshot-border-color: #3f3f3f;
}
}

Expand Down
5 changes: 2 additions & 3 deletions src/static/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@
@import "base/footer.scss";
@import "base/images_wide.scss";
@import "base/latex.scss";
@import "base/nav.scss";
@import "base/post_cards.scss";
@import "base/pygments.scss";
@import "base/tweets.scss";

@import "components/nav.scss";
@import "components/pretty_hr.scss";
@import "components/syntax_highlighting.scss";

$primary-color-light: #d01c11;
$primary-color-dark: #ff4242;
Expand Down

0 comments on commit 7a3afa8

Please sign in to comment.