GithubHelp home page GithubHelp logo

lxsmnsyc / tailwind-layouts Goto Github PK

View Code? Open in Web Editor NEW
62.0 4.0 10.0 1.3 MB

Collection of Tailwind Layouts

Home Page: https://tailwind-layouts.vercel.app

License: MIT License

HTML 14.76% JavaScript 0.11% TypeScript 84.84% CSS 0.29%
tailwindcss tailwind esbuild playground react lit-html skypack esm cdn-imports preact

tailwind-layouts's Introduction

tailwind-layouts

image

A collection of Tailwind Layouts

Playground

The website includes a client-side playground which allows components to be rendered and tweaked in real-time. The playground uses Split.js to allow resizable editor and live code output.

Editor

tailwind-layouts uses Microsoft's Monaco Editor (more specifically, @monaco-editor/react) to view and edit the component's code.

Live Code

tailwind-layouts uses ESBuild to transform and render the component in real-time. JSX and TypeScript is supported, but the compiled code is transformed into ES2017 for browser compatibility. The compiled code format is also in ESM. The code is then transported to an in-document iframe that performs an ESM HMR-like mechanism.

Since Tailwind only generates classes during build-time, tailwind-layouts instead uses twind to generate classes on runtime, as well as add support for JIT.

CDN Imports

Since the compiled code's format is in ESM, tailwind-layouts allows CDN imports. You can check out Skypack.

Live TypeScript definitions

When importing packages from Skypack or UNPKG, tailwind-layouts will attempt to load the TypeScript declarations of the imported package in real-time, allowing you to have a type-safe environment in the playground.

Source Map

Since ESBuild transforms the input code, it may lose context of what the original source may look like, so it exports a source map information of the source content. However, errors would have a hard time showing what the original source's stack looks like, therefor tailwind-layouts uses source-map-support to shim source map stack traces.

Environments

tailwind-layouts currently supports the following implementations:

Upcoming implemenations:

  • Inferno
  • Vue 2
  • Vue 3 SFC
  • Svelte

License

MIT © lxsmnsyc

tailwind-layouts's People

Contributors

lxsmnsyc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

tailwind-layouts's Issues

Installing packages fails on fresh clone of repo

Steps to reproduce:

  1. git clone repo
  2. npm install

Results in the following error:

npm i
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/monaco-editor
npm ERR!   monaco-editor@"^0.24.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer monaco-editor@"^0.23.0" from @monaco-editor/[email protected]
npm ERR! node_modules/@monaco-editor/react
npm ERR!   @monaco-editor/react@"^4.1.3" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\Lewy\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Lewy\AppData\Local\npm-cache\_logs\2021-06-24T03_19_25_628Z-debug.log

OS: Windows

Workaround:

npm install --legacy-peer-deps

This seems to work, although in my experience usually this is a fragile workaround.

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.