{"id":16969701,"url":"https://github.com/webmasterdevlin/heroes-svelte-tailwind","last_synced_at":"2025-04-12T00:20:55.039Z","repository":{"id":37838966,"uuid":"205221460","full_name":"webmasterdevlin/heroes-svelte-tailwind","owner":"webmasterdevlin","description":"Tour of Heroes using Svelte and Tailwind CSS","archived":false,"fork":false,"pushed_at":"2022-12-04T09:42:19.000Z","size":537,"stargazers_count":8,"open_issues_count":11,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T20:05:30.062Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://devlinduldulao-svelte-tailwind.netlify.com/","language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/webmasterdevlin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-29T17:59:45.000Z","updated_at":"2023-01-29T20:40:47.000Z","dependencies_parsed_at":"2023-01-22T20:45:52.611Z","dependency_job_id":null,"html_url":"https://github.com/webmasterdevlin/heroes-svelte-tailwind","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webmasterdevlin%2Fheroes-svelte-tailwind","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webmasterdevlin%2Fheroes-svelte-tailwind/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webmasterdevlin%2Fheroes-svelte-tailwind/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webmasterdevlin%2Fheroes-svelte-tailwind/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webmasterdevlin","download_url":"https://codeload.github.com/webmasterdevlin/heroes-svelte-tailwind/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248498086,"owners_count":21114035,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T00:26:10.686Z","updated_at":"2025-04-12T00:20:55.014Z","avatar_url":"https://github.com/webmasterdevlin.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# My version of Tour of Heroes app using Svelte.\n\n### Features\nTailwind, store for state management, HTTP request (using axios), navigation params, 2 stores, computed values.\nUrl of deployed Svelte app. [https://devlinduldulao-svelte-tailwind.netlify.com](https://devlinduldulao-svelte-tailwind.netlify.com)\n\n### To run the project after cloning\n\nCreate or go to your demo directory then run the following in the terminal or cmd.\n\n```sh\n$ git clone https://github.com/webmasterdevlin/heroes-svelte-tailwind.git\n$ cd heroes-svelte-tailwind\n$ npm install\n$ npm run start\n```\n\nThe Svelte app and the fake web service will run concurrently.\n\n---\n\n![screenshot](./tailwind.png)\n\n---\n\n## Tailwind.css installation\n\n### Setting up Tailwind with svelte is really simple, just install Tailwind and pocstcss-cli:\n\n```sh\nnpm install tailwindcss postcss-cli --save-dev\n```\n\nIf you want to remove unused styles, add PurgeCSS as well\n\n```\nnpm install @fullhuman/postcss-purgecss\n```\n\nCreate your Tailwind config file\n\n```sh\n./node_modules/.bin/tailwind init tailwind.js\n```\n\nCreate a `postcss.config.js` file and add this to it\n\n```js\nconst tailwindcss = require(\"tailwindcss\");\n\n// only needed if you want to purge\nconst purgecss = require(\"@fullhuman/postcss-purgecss\")({\n  content: [\"./src/**/*.svelte\", \"./public/**/*.html\"],\n  defaultExtractor: content =\u003e content.match(/[A-Za-z0-9-_:/]+/g) || []\n});\n\nmodule.exports = {\n  plugins: [\n    tailwindcss(\"./tailwind.js\"),\n\n    // only needed if you want to purge\n    ...(process.env.NODE_ENV === \"production\" ? [purgecss] : [])\n  ]\n};\n```\n\nNext, create a CSS file for your Tailwind styles. You have to store in it public folder `public/tailwind.css` and add this to it :\n\n```css\n@tailwind base;\n@tailwind components;\n@tailwind utilities;\n```\n\nUpdate your `package.json` with the custom scripts.\n\n`build:tailwind is only needed if you want to purge`\n\n```js\n\"scripts\": {\n    \"watch:tailwind\": \"postcss public/tailwind.css -o public/index.css -w\",\n    \"build:tailwind\": \"NODE_ENV=production postcss public/tailwind.css -o public/index.css\",\n    \"dev\": \"run-p start:dev autobuild watch:build\",\n    \"build\": \"npm run build:tailwind \u0026\u0026 rollup -c\",\n\n}\n```\n\nFinally, add a stylesheet link to your `public/index.html` file\n\n```html\n\u003clink rel=\"stylesheet\" href=\"index.css\" /\u003e\n```\n\n## Project setup\n\n```\nnpm install\n```\n\n### Compiles and hot-reloads for development\n\n```\nnpm run dev\n```\n\n### Compiles and minifies for production\n\n```\nnpm run build\n```\n\n---\n\n# Svelte README\n\nThis is a project template for [Svelte](https://svelte.dev) apps. It lives at https://github.com/sveltejs/template.\n\nTo create a new project based on this template using [degit](https://github.com/Rich-Harris/degit):\n\n```bash\nnpx degit sveltejs/template svelte-app\ncd svelte-app\n```\n\n*Note that you will need to have [Node.js](https://nodejs.org) installed.*\n\n\n## Get started\n\nInstall the dependencies...\n\n```bash\ncd svelte-app\nnpm install\n```\n\n...then start [Rollup](https://rollupjs.org):\n\n```bash\nnpm run dev\n```\n\nNavigate to [localhost:5000](http://localhost:5000). You should see your app running. Edit a component file in `src`, save it, and reload the page to see your changes.\n\n\n## Deploying to the web\n\n### With [now](https://zeit.co/now)\n\nInstall `now` if you haven't already:\n\n```bash\nnpm install -g now\n```\n\nThen, from within your project folder:\n\n```bash\ncd public\nnow\n```\n\nAs an alternative, use the [Now desktop client](https://zeit.co/download) and simply drag the unzipped project folder to the taskbar icon.\n\n### With [surge](https://surge.sh/)\n\nInstall `surge` if you haven't already:\n\n```bash\nnpm install -g surge\n```\n\nThen, from within your project folder:\n\n```bash\nnpm run build\nsurge public\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebmasterdevlin%2Fheroes-svelte-tailwind","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebmasterdevlin%2Fheroes-svelte-tailwind","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebmasterdevlin%2Fheroes-svelte-tailwind/lists"}