Skip to content

Commit

Permalink
feat: vanilla-extract style system (#97)
Browse files Browse the repository at this point in the history
* chore: add semantic colors, typography

* chore: co-locate & flatten tokens

* chore: swap sprinkles for rainbow-sprinkles

* chore: create initial sprinkles file

* fix: remove token prefix, update base theme

* feat: add additional sprinkles properties

* chore: migrate resources tab to sprinkles

* chore: add missing deps, pin deps

* chore: fix lint errors
  • Loading branch information
helmturner authored Mar 9, 2024
1 parent 8e04a60 commit 4aa3bb8
Show file tree
Hide file tree
Showing 14 changed files with 1,250 additions and 624 deletions.
630 changes: 336 additions & 294 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
"@types/react": "18.2.64",
"@types/react-dom": "18.2.21",
"@vanilla-extract/css": "1.14.1",
"@vanilla-extract/sprinkles": "1.6.1",
"@vanilla-extract/recipes": "0.5.2",
"@zendeskgarden/container-tabs": "2.0.10",
"astro": "4.4.15",
"rainbow-sprinkles": "0.17.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"swagger-ui-react": "5.11.10",
Expand All @@ -38,7 +39,7 @@
"@types/eslint__js": "8.42.3",
"@types/eslint-config-prettier": "6.11.3",
"@types/node": "20.11.25",
"@types/swagger-ui-react": "^4.18.3",
"@types/swagger-ui-react": "4.18.3",
"@typescript-eslint/eslint-plugin": "7.0.2",
"@vanilla-extract/vite-plugin": "4.0.6",
"@vitest/coverage-v8": "1.3.1",
Expand Down
77 changes: 51 additions & 26 deletions src/components/hacknight/ResourcesTab.tsx
Original file line number Diff line number Diff line change
@@ -1,52 +1,77 @@
import styles from './styles.module.css';
import {
container,
section,
topic,
sectionH2,
twoColumnOuter,
list,
sectionH3,
sectionFooter,
} from './styles.css.ts';

export default function ResourcesTab() {
return (
<div className={styles.container}>
<section className={styles.section} id="resources">
<p id="topic" className={styles.topic}>
<div className={container.className} style={container.style}>
<section
className={section.className}
style={section.style}
id="resources"
>
<p id="topic" className={topic.className} style={topic.style}>
Resources
</p>
<h2 className={styles.section_h2}>Stuff we use</h2>
<h2 className={sectionH2.className} style={sectionH2.style}>
Stuff we use
</h2>
<br />
<div className={styles.two_column_grid}>
<ul className={styles.list}>
<h3 className={styles.section_h3}>Collaboration Tools</h3>
<li className={styles.list_item}>
<a href="https://github.com/tulsawebdevs/website">TWD Github</a>
<div className={twoColumnOuter.className} style={twoColumnOuter.style}>
<ul className={list.className} style={list.style}>
<h3 className={sectionH3.className} style={sectionH3.style}>
Collaboration Tools
</h3>
<li>
<a href="https://github.com/tulsawebdevs/website">TWD Github</a>
</li>
<li className={styles.list_item}>
<li>
{' '}
<a href="https://github.com/tulsawebdevs/website/projects?query=is%3Aopen">
TWD Active Projects
TWD Active Projects{' '}
</a>
</li>
<li className={styles.list_item}>
<li>
{' '}
<a href="https://www.meetup.com/tulsa-web-devs/">
Upcoming Events
</a>
</li>
<li className={styles.list_item}>
<a href="https://g.co/kgs/V1Dxko2">Directions to 36º North</a>
<li>
<a href="https://g.co/kgs/V1Dxko2">Directions to 36º North</a>
</li>
</ul>

<ul className={styles.list}>
<h3 className={styles.section_h3}>Learning Resources</h3>
<li className={styles.list_item}>
<a href="https://www.freecodecamp.org/">FreeCodeCamp</a>
<ul className={list.className} style={list.style}>
<h3 className={sectionH3.className} style={sectionH3.style}>
Learning Resources
</h3>
<li>
<a href="https://www.freecodecamp.org/">FreeCodeCamp</a>
</li>
<li className={styles.list_item}>
<a href="https://www.codecademy.com/">Codecademy</a>
<li>
<a href="https://www.codecademy.com/">Codecademy</a>
</li>
<li className={styles.list_item}>
<a href="https://www.udemy.com/">Udemy</a>
<li>
<a href="https://www.udemy.com/">Udemy</a>
</li>
<li className={styles.list_item}>
<a href="https://www.khanacademy.org/">Khan Academy</a>
<li>
<a href="https://www.khanacademy.org/">Khan Academy</a>
</li>
</ul>
</div>
<p className={styles.section_footer}>
<p
className={sectionFooter.className}
id="section_footer"
style={sectionFooter.style}
>
Reach out to us on{' '}
<a href="https://slack.techlahoma.org">Slack at #ug-tulsa-webdevs </a>
if you have any questions!
Expand Down
191 changes: 191 additions & 0 deletions src/components/hacknight/styles.css.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
import { sprinkles } from '../../design/sprinkles.css.ts';

const container = sprinkles({
display: 'flex',
flexDirection: 'column',
maxWidth: '800px',
padding: '5px',
placeContent: 'center',
});

const topic = sprinkles({
fontSize: 'calc(1.25rem + 1.25vw)',
alignSelf: 'center',
fontWeight: 500,
});

const section = sprinkles({
padding: '20px',
borderRadius: '$4',
shadowColor: '$black',
});

const sectionH2 = sprinkles({
fontSize: '$8',
paddingBottom: '$2',
color: '$twd-blue-400',
borderBottomStyle: 'solid',
borderColor: '$twd-blue-700',
borderWidth: '$0',
borderBottomWidth: '$0.5',
});

const sectionH3 = sprinkles({
fontSize: '$6',
paddingBottom: '$2',
color: '$twd-blue-400',
});

const sectionFooter = sprinkles({
fontSize: '$7',
paddingX: '$2',
fontWeight: 600,
textAlign: 'center',
});

const sectionFooterHover = sprinkles({
textDecoration: 'underline',
});

const emphasis = sprinkles({
fontWeight: 700,
textDecoration: 'underline',
});

const list = sprinkles({
paddingLeft: '$4',
});

const tip = sprinkles({
display: 'flex',
backgroundColor: '$twd-blue-700',
opacity: 0.8,
padding: '$2',
borderRadius: '$4',
});

const tipText = sprinkles({
fontStyle: 'italic',
flexGrow: 1,
textAlign: 'center',
});

const link = sprinkles({
color: '$twd-blue-400',
textDecoration: 'underline',
});

const twoColumnOuter = sprinkles({
display: 'flex',
flexDirection: 'row',
placeItems: 'space-around',
});

const twoColumnSide = sprinkles({
flex: '$1',
maxWidth: '100%',
});

export {
container,
topic,
section,
sectionH2,
sectionH3,
sectionFooter,
sectionFooterHover,
emphasis,
list,
tip,
tipText,
link,
twoColumnOuter,
twoColumnSide,
};
// .container {
// max-width: 800px;
// margin: auto;
// padding: 5px;
// }

// .topic {
// font-size: calc(1.25rem + 1.25vw);
// align-self: center;
// font-weight: 500;
// }

// .section {
// margin: 20px 0;
// padding: 20px;
// border-radius: 8px;
// box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
// }

// .section_h2 {
// font-size: 22px;
// padding-bottom: 5px;
// color: rgb(var(--accent-light));
// border-bottom: solid;
// border-color: rgb(var(--accent-dark));
// }

// .section_h3 {
// font-size: 18px;
// padding-bottom: 5px;
// color: rgb(var(--accent-light));
// }

// .section_footer {
// font-size: 20px;
// padding-block: 10px;
// font-weight: 600;
// text-align: center;
// }

// .section_footer:hover {
// text-decoration-line: underline;
// }

// .emphasis {
// font-weight: 700;
// text-decoration: underline;
// }

// .list {
// padding-inline-start: 20px;
// }

// .list_item::before {
// content: '☞';
// margin-right: 5px;
// }

// .tip {
// display: flex;
// background-color: rgb(var(--accent-dark));
// opacity: 0.8;
// padding: 10px;
// border-radius: 8px;
// }

// .tip_text {
// font-style: italic;
// flex-grow: 1;
// text-align: center;
// }

// .tip::before {
// content: '💡';
// margin-right: 5px;
// }

// .link {
// color: rgb(var(--accent-light));
// text-decoration: underline;
// }

// .two_column_grid {
// display: grid;
// grid-template-columns: 1fr 1fr;
// gap: 20px;
// }
65 changes: 0 additions & 65 deletions src/design/fonts/index.css.ts

This file was deleted.

Loading

0 comments on commit 4aa3bb8

Please sign in to comment.