1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2026-01-15 08:02:56 -05:00

run prettier over every file

This commit is contained in:
2021-10-31 16:51:19 -04:00
parent f4ebeeb1b8
commit c7fdda36af
16 changed files with 34 additions and 79 deletions

View File

@@ -29,10 +29,9 @@ if (contactForm) {
// https://simonplend.com/how-to-use-fetch-to-post-form-data-as-json-to-your-api/
const formData = Object.fromEntries(new FormData(event.currentTarget).entries());
// some client-side validation, these are all also checked on the server
// to be safe but we can save some unnecessary requests here.
// we throw identical error messages to the server's so they're caught in
// the same way below.
// some client-side validation. these are all also checked on the server to be safe but we can save some
// unnecessary requests here.
// we throw identical error messages to the server's so they're caught in the same way below.
if (!formData.name || !formData.email || !formData.message) {
throw new Error("USER_MISSING_DATA");
}

View File

@@ -17,8 +17,7 @@ initDarkMode({
// make toggle visible now that we know JS is enabled
t.style.display = "block";
// HACK: re-enable theme transitions after a very short delay, otherwise
// there's a weird race condition (2/2)
// HACK: re-enable theme transitions after a very short delay, otherwise there's a weird race condition (2/2)
setTimeout(() => {
document.head.removeChild(disableTransitionCSSHack);
}, 500);

View File

@@ -28,10 +28,7 @@ if (wrapper) {
<div class="repo-meta">
${repo.language
? html`<div class="repo-meta-item">
<span
class="repo-language-color"
style="background-color: ${ifDefined(repo.language.color)}"
></span>
<span class="repo-language-color" style="background-color: ${ifDefined(repo.language.color)}"></span>
<span>${repo.language.name}</span>
</div>`
: null}

View File

@@ -7,13 +7,12 @@
// Gradient hack to get our custom underline to wrap:
// https://www.dannyguo.com/blog/animated-multiline-link-underlines-with-css/
@function underline-hack($color) {
// [deprecated] Calculate lighter underline color compared to text
// color by mix()'ing with background (#fff) to give the impression
// of opacity but with MUCH better compatibility.
// [deprecated] Calculate lighter underline color compared to text color by mix()'ing with background (#fff) to give
// the impression of opacity but with MUCH better compatibility.
// $color-opaque-hex: mix($color, $link-opacity-color, $link-underline-opacity);
// Less compatible but better for light/dark mode switching.
// We fall back to non-alpha hex colors with postcss-color-rgba-fallback to mitigate this.
// Less compatible but better for light/dark mode switching. We fall back to non-alpha hex colors with
// postcss-color-rgba-fallback to mitigate this.
// stylelint-disable-next-line color-function-notation
$color-opaque-alpha: rgba($color, math.div(settings.$link-underline-opacity, 100%));
@@ -22,8 +21,7 @@
@return linear-gradient($color-opaque-alpha, $color-opaque-alpha);
}
// Returns a list of strings from a given string separated by a given
// separator (defaults to comma).
// Returns a list of strings from a given string separated by a given separator (defaults to comma).
// https://stackoverflow.com/a/65853667/1438024
@function str-split($str, $separator: ",") {
// return immediately if this function isn't necessary
@@ -35,17 +33,10 @@
@while string.index("#{$str}", "#{$separator}") != null {
@if string.index("#{$str}", "#{$separator}") > 1 {
$str-list: list.append(
$str-list,
string.slice("#{$str}", 1, string.index("#{$str}", "#{$separator}") - 1)
);
$str-list: list.append($str-list, string.slice("#{$str}", 1, string.index("#{$str}", "#{$separator}") - 1));
}
$str: string.slice(
"#{$str}",
string.index("#{$str}", "#{$separator}") + 1,
string.length("#{$str}")
);
$str: string.slice("#{$str}", string.index("#{$str}", "#{$separator}") + 1, string.length("#{$str}"));
}
@if string.slice("#{$str}", 1, string.length("#{$str}")) != "" {

View File

@@ -9,10 +9,9 @@ $webfont-mono-variable: "Roboto Mono var";
// System fonts
// https://markdotto.com/2018/02/07/github-system-fonts/
// stylelint-disable-next-line value-keyword-case
$system-fonts-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif,
"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
$system-fonts-monospace: "SFMono-Regular", "Consolas", "Liberation Mono", "Menlo", "Courier",
monospace;
$system-fonts-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji",
"Segoe UI Emoji", "Segoe UI Symbol";
$system-fonts-monospace: "SFMono-Regular", "Consolas", "Liberation Mono", "Menlo", "Courier", monospace;
$font-stack-sans: list.join($webfont-sans, $system-fonts-sans);
$font-stack-variable: list.join($webfont-sans-variable, $system-fonts-sans);
$font-stack-mono: list.join($webfont-mono, $system-fonts-monospace);

View File

@@ -16,9 +16,7 @@
@each $element in settings.$theme-transition-elements {
$transitions: list.append(
$transitions,
string.unquote(
"#{$element} #{settings.$theme-transition-duration} #{settings.$theme-transition-function}"
)
string.unquote("#{$element} #{settings.$theme-transition-duration} #{settings.$theme-transition-function}")
);
}
@if $moreTransitions != "" {