1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-04-27 03:58:28 -04:00

switch some style props to css

This commit is contained in:
Jake Jarvis 2022-03-03 11:46:18 -05:00
parent 4e32048cca
commit dc7622a7af
Signed by: jake
GPG Key ID: 2B0C9CF251E69A39
6 changed files with 32 additions and 23 deletions

View File

@ -250,7 +250,7 @@ const ContactForm = ({ className }: ContactFormProps) => {
<MarkdownTip> <MarkdownTip>
Basic{" "} Basic{" "}
<Link href="https://commonmark.org/help/" title="Markdown reference sheet" style={{ fontWeight: 600 }}> <Link href="https://commonmark.org/help/" title="Markdown reference sheet" css={{ fontWeight: 600 }}>
Markdown syntax Markdown syntax
</Link>{" "} </Link>{" "}
is allowed here, e.g.: <strong>**bold**</strong>, <em>_italics_</em>, [ is allowed here, e.g.: <strong>**bold**</strong>, <em>_italics_</em>, [

View File

@ -1,5 +1,6 @@
import { styled } from "../../lib/styles/stitches.config"; import { styled } from "../../lib/styles/stitches.config";
import type { ComponentProps } from "react"; import type { ComponentProps } from "react";
import type * as Stitches from "@stitches/react";
const RoundedIFrame = styled("iframe", { const RoundedIFrame = styled("iframe", {
width: "100%", width: "100%",
@ -15,9 +16,10 @@ export type IFrameProps = ComponentProps<typeof RoundedIFrame> & {
width?: number; // defaults to 100% width?: number; // defaults to 100%
allowScripts?: boolean; allowScripts?: boolean;
noScroll?: boolean; noScroll?: boolean;
css?: Stitches.CSS;
}; };
const IFrame = ({ src, title, height, width, allowScripts, noScroll, ...rest }: IFrameProps) => ( const IFrame = ({ src, title, height, width, allowScripts, noScroll, css, ...rest }: IFrameProps) => (
<RoundedIFrame <RoundedIFrame
src={src} src={src}
title={title} title={title}
@ -27,6 +29,7 @@ const IFrame = ({ src, title, height, width, allowScripts, noScroll, ...rest }:
css={{ css={{
height: `${height}px`, height: `${height}px`,
maxWidth: width ? `${width}px` : null, maxWidth: width ? `${width}px` : null,
...css,
}} }}
{...rest} {...rest}
/> />

View File

@ -1,5 +1,6 @@
import { memo } from "react"; import { memo } from "react";
import { styled, keyframes } from "../../lib/styles/stitches.config"; import { styled, keyframes } from "../../lib/styles/stitches.config";
import type * as Stitches from "@stitches/react";
const pulse = keyframes({ const pulse = keyframes({
"0%, 80%, 100%": { "0%, 80%, 100%": {
@ -26,10 +27,11 @@ export type LoadingProps = {
width: number; // of entire container, in pixels width: number; // of entire container, in pixels
boxes?: number; // total number of boxes (default: 3) boxes?: number; // total number of boxes (default: 3)
timing?: number; // staggered timing between each box's pulse, in seconds (default: 0.1s) timing?: number; // staggered timing between each box's pulse, in seconds (default: 0.1s)
css?: Stitches.CSS;
className?: string; className?: string;
}; };
const Loading = ({ width, boxes = 3, timing = 0.1, className }: LoadingProps) => { const Loading = ({ width, boxes = 3, timing = 0.1, css, className }: LoadingProps) => {
// each box is just an empty div // each box is just an empty div
const divs = []; const divs = [];
@ -51,9 +53,10 @@ const Loading = ({ width, boxes = 3, timing = 0.1, className }: LoadingProps) =>
return ( return (
<Wrapper <Wrapper
className={className} className={className}
style={{ css={{
width: `${width}px`, width: `${width}px`,
height: `${width / 2}px`, height: `${width / 2}px`,
...css,
}} }}
> >
{divs} {divs}

View File

@ -38,15 +38,15 @@ const Hillary = () => (
<Copyright> <Copyright>
Video is property of{" "} Video is property of{" "}
<Link href="https://www.hillaryclinton.com/" style={{ fontWeight: 700 }}> <Link href="https://www.hillaryclinton.com/" css={{ fontWeight: 700 }}>
Hillary for America Hillary for America
</Link> </Link>
, the{" "} , the{" "}
<Link href="https://democrats.org/" style={{ fontWeight: 700 }}> <Link href="https://democrats.org/" css={{ fontWeight: 700 }}>
Democratic National Committee Democratic National Committee
</Link> </Link>
, and{" "} , and{" "}
<Link href="https://cnnpressroom.blogs.cnn.com/" style={{ fontWeight: 700 }}> <Link href="https://cnnpressroom.blogs.cnn.com/" css={{ fontWeight: 700 }}>
CNN / WarnerMedia CNN / WarnerMedia
</Link> </Link>
. &copy; 2016. . &copy; 2016.

View File

@ -1,6 +1,7 @@
import Content from "../components/Content/Content"; import Content from "../components/Content/Content";
import Link, { CustomLinkProps } from "../components/Link/Link"; import Link, { CustomLinkProps } from "../components/Link/Link";
import { styled, keyframes, darkTheme } from "../lib/styles/stitches.config"; import { styled, keyframes, darkTheme } from "../lib/styles/stitches.config";
import type * as Stitches from "@stitches/react";
const Wrapper = styled(Content, { const Wrapper = styled(Content, {
fontSize: "1em", fontSize: "1em",
@ -10,13 +11,14 @@ const Wrapper = styled(Content, {
const ColorfulLink = ({ const ColorfulLink = ({
lightColor, lightColor,
darkColor, darkColor,
css,
...rest ...rest
}: CustomLinkProps & { }: CustomLinkProps & {
lightColor: string; lightColor: string;
darkColor: string; darkColor: string;
css?: Stitches.CSS;
}) => { }) => {
return ( return (
<>
<Link <Link
css={{ css={{
color: lightColor, color: lightColor,
@ -26,10 +28,11 @@ const ColorfulLink = ({
color: darkColor, color: darkColor,
backgroundGradientHack: { color: darkColor }, backgroundGradientHack: { color: darkColor },
}, },
...css,
}} }}
{...rest} {...rest}
/> />
</>
); );
}; };
@ -330,7 +333,7 @@ const Index = () => (
title="My Public Key" title="My Public Key"
lightColor="#757575" lightColor="#757575"
darkColor="#959595" darkColor="#959595"
style={{ background: "none" }} css={{ background: "none !important" }}
forceNewWindow forceNewWindow
> >
<code>🔐 2B0C 9CF2 51E6 9A39</code> <code>🔐 2B0C 9CF2 51E6 9A39</code>

View File

@ -39,11 +39,11 @@ const Leo = () => (
<Copyright> <Copyright>
Video is property of{" "} Video is property of{" "}
<Link href="https://web.archive.org/web/20070511004304/http://www.g4techtv.ca/" style={{ fontWeight: 700 }}> <Link href="https://web.archive.org/web/20070511004304/http://www.g4techtv.ca/" css={{ fontWeight: 700 }}>
G4techTV Canada G4techTV Canada
</Link>{" "} </Link>{" "}
&amp;{" "} &amp;{" "}
<Link href="https://leolaporte.com/" style={{ fontWeight: 700 }}> <Link href="https://leolaporte.com/" css={{ fontWeight: 700 }}>
Leo Laporte Leo Laporte
</Link> </Link>
. &copy; 2007 G4 Media, Inc. . &copy; 2007 G4 Media, Inc.