Examples of using various CSS-in-JS libs in Astro (repo for withastro/astro#4432)

Overview

astro + css-in-js

This monorepo will show examples of various CSS-in-JS libraries in Astro. Currently only shows a basic counter example, would be nice to demonstrate more advanced usage for each library.

Compatibility table

Library Status Notes
styled-components 🟡 Partially works Prod build errors with: styled.div is not a function.
Can be worked around with client:only or by using vite.legacy.buildSsrCjsExternalHeuristics and vite.ssr.noExternal (will cause FOUC though).
emotion 🟡 Partially works Prod build errors with: styled.div is not a function.
Can be worked around with client:only or by using vite.legacy.buildSsrCjsExternalHeuristics and vite.ssr.noExternal (will cause FOUC though).
linaria Works Prod build errors with: Named export 'styled' not found..
Can be worked around using vite.legacy.buildSsrCjsExternalHeuristics and vite.ssr.noExternal or by downgrading to v3.
stitches Works <style> tag for SSR needs to be in React component
typestyle Works -
vanilla-extract Works -
solid-styled Doesn't work No vite or rollup plugin, also requires Context

Running locally

Clone the repo and install deps:

npm install

Start the dev server for all examples in parallel using turborepo:

npm run dev

Open localhost:3000, localhost:3001, etc in browser.

Contributing

To add an example of a new library:

  1. Create a copy of any folder (e.g. emotion).
  2. Rename the folder and the name field in the folder's package.json.
  3. Update the dependencies and run npm install from the root of the monorepo.
  4. Update the code. Try to keep the actual styles more or less the same.
  5. Update the README.md
You might also like...

🤪 A list of funny and tricky JavaScript examples

🤪 A list of funny and tricky JavaScript examples

🤪 A list of funny and tricky JavaScript examples

Jan 1, 2023

🚀🚀 A Shopify embedded app starter template, with updated dependencies, session storage, app context and examples for basic functionalities.

Shopify Node App Starter This is a starter template for embedded shopify apps based on the shopify cli node app. Contributions to create the perfect s

Jan 8, 2023

Verbosely Documented, Minimal Starknet Contract Examples.

cairo-by-example • Verbosely Documented, Minimal Starknet Contract Examples. Cairo By Example deployed to https://cairo-by-example.xyz Developing Clon

Dec 6, 2022

Live Reload Examples

Live Reload Examples Examples of live reloading code to create a fast feedback loop. Examples in this code repo accompany a soon to be published blog

Sep 29, 2022

Examples for Evolllution talk about omni api's

These are examples for the 2022 Evolution Conference. These are only intended for learning puposes so you can learn and develop your own tool set. P

Jun 3, 2022

Offline rendering examples at the command line with Node.js

Elementary Audio Offline Rendering Examples This repository holds a set of small examples using Elementary in Node.js to process audio files. Each sub

Jun 12, 2022

Examples and challenges of my video about Creating and testing a complete Node.js Rest API (Without frameworks)

Building a complete Node.js WebApi + testing with no frameworks Welcome, this repo is part of my youtube video about Creating and testing a complete N

Dec 23, 2022

This is a demo project for the SecTester JS SDK framework, with some installation and usage examples

This is a demo project for the SecTester JS SDK framework, with some installation and usage examples

SecTester SDK Demo Table of contents About this project About SecTester Setup Fork and clone this repo Get a Bright API key Explore the demo applicati

Dec 16, 2022

three.js examples. if you are first in learning three.js , this will give you much help.

three.js examples. if you are first in learning three.js , this will give you much help.

three-projected-material Three.js Material which lets you do Texture Projection on a 3d Model. Installation After having installed three.js, install i

Nov 2, 2022
Owner
Mayank
Mayank
An users NodeJS API without packages libs or frameworks!

NodeJS Users API - Without Frameworks And Packages ?? Table of Contents About Getting Started Usage Built Using Authors ?? About Purpose of this proje

Nathan Cotrim Lemos 31 Feb 7, 2022
Tutorials for MATH 4432 Statistical Machine Learning, HKUST, Fall 2022

Tutorials for MATH 4432 Statistical Machine Learning Course information MATH 4432 Statistical Machine Learning Instructor: Prof. YANG Can Teaching ass

WANG Zhiwei 7 Dec 1, 2022
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
This project will be using various AI and Rule Engine algorithm to detect various attack against a company!

?? Introduction This project will be using various AI and Rule Engine algorithm to detect various attack against a website! ?? Mission After starting

Harish S.G 4 Apr 29, 2022
This is email scheduler made using MERN. This repo contains server code, client repo is linked in readme.

Email Scheduler Client This is an email scheduler server (client in different repository). It is made using node.js/express.js. Overview User can sign

Sai Charan 2 Dec 3, 2022
🦔 AstroJS GoogleChromeLabs critters integration. Inline your critical CSS with Astro.

astro-critters ?? This Astro integration brings critters to your Astro project. Critters is a plugin that inlines your app's critical CSS and lazy-loa

Nikola Hristov 33 Dec 11, 2022
A community-driven repository showcasing examples using Remix 💿

Remix Examples Welcome to @remix-run/examples! If you have an example you'd like to share, please submit a pull request! This is a community-driven re

Remix 301 Jan 3, 2023
Examples of how to do query, style, dom, ajax, event etc like jQuery with plain javascript.

You (Might) Don't Need jQuery Frontend environments evolve rapidly nowadays and modern browsers have already implemented a great deal of DOM/BOM APIs

NEFE 20.3k Dec 24, 2022
Functions Recipes is a library of examples to help you getting started with Salesforce Functions and get used to their main features.

Functions Recipes Introduction Salesforce Functions lets you use the Salesforce Platform for building event-driven, elastically scalable apps and expe

Trailhead Apps 172 Dec 29, 2022