Giter Club home page Giter Club logo

vps-panda-css's Introduction

vite-plugin-ssr with Panda CSS

This is a demo of how to use vite-plugin-ssr with Panda css.

This is a very simple example just to show the integration between the two libraries and how to make a simple dark the theme ssr compatible.

How to use

Install dependencies

I used pnpm to install the dependencies, but you can use npm or yarn as well.

pnpm install

or

yarn install

or

npm install

Run dev server

Use the "dev" script from package.json, be sure to have the 3000 port available.

Build

Use the "build" script from package.json, the build will be in the "dist" folder. By default this example is using prerendering, you can change this in the "vite.config.js" file.

Run

Use the "server:prod" to run the server in production mode. or use the "prod" script to build and run the server.

How it works

It use the @pandacss/dev with postcss library to generate the css. The app include a small script to apply the user preference for the theme before page load. The theme is stored in the localStorage and the user can change it by clicking on the button in the navbar.

The styled-system directory was generate by pandacss with the command:

npx panda init

Then just need to add the pandacss base layers to an index.css file, import it in your app and you are good to go.

This app shows a really small example of what you can do with the theming file from pandacss "panda.config.ts" like variants and semanticTokens.

Features

  • Panda CSS
  • Dark theme
  • Theming
  • Variant example
  • Prerendering by default (can be disabled in vite.config.js)
  • Server Side Rendering is possible as well
  • TypeScript
  • Client routing provided by vite-plugin-ssr

Contributing

I made this without any documentation, Pull requests and issues are welcome ๐Ÿ˜Š!

vps-panda-css's People

Contributors

renovate[bot] avatar yannbirba avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

vps-panda-css's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • fix(deps): update dependency vite-plugin-ssr to v0.4.142
  • fix(deps): update dependency @types/node to v18.19.44
  • fix(deps): update dependency @vitejs/plugin-react to v4.3.1
  • fix(deps): update dependency eslint to v8.57.0
  • fix(deps): update dependency eslint-plugin-react to v7.35.0
  • fix(deps): update dependency postcss-preset-env to v9.6.0
  • fix(deps): update dependency typescript to v5.5.4
  • fix(deps): update dependency vite to v4.5.3
  • fix(deps): update react monorepo (@types/react, @types/react-dom, eslint-plugin-react-hooks, react, react-dom)
  • fix(deps): update typescript-eslint monorepo to v6.21.0 (@typescript-eslint/eslint-plugin, @typescript-eslint/parser)
  • fix(deps): update dependency eslint to v9
  • fix(deps): update dependency postcss-preset-env to v10
  • ๐Ÿ” Create all rate-limited PRs at once ๐Ÿ”

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/build-and-deploy.yml
  • actions/checkout v3
  • pnpm/action-setup v2
  • JamesIves/github-pages-deploy-action v4
npm
package.json
  • @types/compression ^1.7.2
  • @types/express ^4.17.17
  • @types/node ^18.16.17
  • @types/react ^18.2.11
  • @types/react-dom ^18.2.4
  • @typescript-eslint/eslint-plugin ^6.0.0
  • @typescript-eslint/parser ^6.0.0
  • @vitejs/plugin-react ^4.0.0
  • compression ^1.7.4
  • cross-env ^7.0.3
  • eslint ^8.42.0
  • eslint-plugin-react ^7.32.2
  • eslint-plugin-react-hooks ^4.6.0
  • eslint-plugin-react-refresh ^0.4.0
  • express ^4.18.2
  • postcss-flexbugs-fixes ^5.0.2
  • postcss-preset-env ^9.0.0
  • react ^18.2.0
  • react-dom ^18.2.0
  • sirv ^2.0.3
  • ts-node ^10.9.1
  • typescript ^5.0.0
  • vite ^4.3.9
  • vite-plugin-ssr ^0.4.131
  • @pandacss/dev ^0.12.0
nvm
.nvmrc
  • node 19

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.