{"id":13857299,"url":"https://github.com/kylebutts/tailwindr","last_synced_at":"2025-10-08T01:32:05.868Z","repository":{"id":113351356,"uuid":"393823599","full_name":"kylebutts/tailwindr","owner":"kylebutts","description":"TailwindCSS + RMarkdown","archived":false,"fork":false,"pushed_at":"2021-08-18T01:54:46.000Z","size":1929,"stargazers_count":38,"open_issues_count":1,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-22T15:40:42.658Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://kylebutts.github.io/tailwindr/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kylebutts.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2021-08-08T01:01:50.000Z","updated_at":"2024-07-29T09:36:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"e7127da3-d14e-43a8-a92d-2c1e78892bcc","html_url":"https://github.com/kylebutts/tailwindr","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/kylebutts%2Ftailwindr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylebutts%2Ftailwindr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylebutts%2Ftailwindr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kylebutts%2Ftailwindr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kylebutts","download_url":"https://codeload.github.com/kylebutts/tailwindr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235669415,"owners_count":19026823,"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-08-05T03:01:32.798Z","updated_at":"2025-10-08T01:32:00.561Z","avatar_url":"https://github.com/kylebutts.png","language":"R","funding_links":[],"categories":["R"],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n# tailwindr\n\n\u003c!-- badges: start --\u003e\n\u003c!-- badges: end --\u003e\n\nThe goal of tailwindr is to bring TailwindCSS to RMarkdown\n\n## Installation\n\nYou can install the development version from [GitHub](https://github.com/) with:\n\n``` r\n# install.packages(\"devtools\")\ndevtools::install_github(\"kylebutts/tailwindr\")\n```\n\n\n## Tailwind CSS\n\nTailwind CSS is a *utility-based* CSS framework that allows really quick and incredibly customizable styling of html all through classes. Here are some example classes\n\n- `my-4` which sets the margin top and bottom to size `4` (Tailwind has sizes that are consistent across classes. 4 happens to be `1rem`)\n- `shadow-sm`/`shadow-md`/`shadow-lg`/`shadow-xl` set a drop shadow on divs\n- `text-left`/`text-center`/`text-right` left/center/right- align text.\n- `w-#/12` sets a column of width #/12 (similar to bootstrap's grid)\n- [Much, much more](https://tailwindcss.com/docs/)\n\nWriting css in Tailwind is incredibly easy too, with the [`@apply`](https://tailwindcss.com/docs/functions-and-directives#apply) directive. For example, lets say you want to create a blue button class, say `.btn-blue`. I can use the `@apply` directive to autmoatically use a bunch of TailwindCSS utility classes:\n\n```css\n.btn-blue {\n  @apply bg-blue-500 hover:bg-blue-700 text-white;\n}\n```\n\nAfter compiling the css, setting `class = \"btn-blue\"` is equivalent to setting `class = \"bg-blue-500 hover:bg-blue-700 text-white\"`. \n\n\n## `tailwind_prose` Output Format\n\nThe `tailwindr::tailwind_prose` Rmarkdown output format makes beautiful typography easy by using uses the css framework TailwindCSS and Tailwing Typography. For more information visit \u003chttps://github.com/tailwindlabs/tailwindcss-typography\u003e.\n\nTo use this Rmd template, you can use the \"From Template\" option in RStuidio or use the following in your preamble:\n\n```\n---\ntitle: \"Template Title\"\nauthor: \"Your Name\"\ndate: \"`r format(Sys.Date(), '%B %d, %Y')`\"\noutput: \n  tailwindr::tailwind_prose:\n    highlight: zenburn\n    self_contained: false\n    slim_css: TRUE\n    css: []\n---\n```\n\n\n### Example Output \n\nView it live by clicking on the image\n\n\u003ca href=\"https://kylebutts.com/tailwindr/\"\u003e\n\u003cimg src=\"vignettes/images/tailwind_prose.png\" width=\"100%\" /\u003e\n\u003c/a\u003e\n\n### Custom templates\n\nYou can also write custom templates to surround the Rmd output in any HTML you want. Look at \u003chttps://github.com/kylebutts/tailwindr/tree/gh-pages/ex_custom_theme\u003e for an example, or view it live at \u003chttps://kylebutts.com/tailwindr/ex_custom_theme/\u003e\n\n\n### Details\n\nThe parameter 'slim_css' uses PostCSS to strip TailwindCSS to include *only* the css classes that *appear* in the final html document. This is great for keeping files very small, but bad if you are trying to edit through chrome or firefox for example. I recommend putting 'slim_css: false' into the yaml while developing and 'slim_css: true' when ready to finish. This requires [node](https://www.npmjs.com/) (npm) to be installed on your system, but the output document automatically handles compiling all the css.\n\nCustom css is possible by passing objects to the 'css' yaml parameter. Importantly, you can use the `@apply` directives that come with tailwind to easily compile set of classes. See \u003chttps://tailwindcss.com/docs/functions-and-directives#apply\u003e for more details. You can create and link css files just as normal, but now you can use all the Tailwind css classes by using `@apply`. When you hit Knit, it will automatically process the CSS for you.\n\nYou can also type custom html in Rmd files, so the possibilities are endless...\n\n\n## `tailwind` Output Format\n\nThere is also a `tailwindr::tailwind` output format that can be used for more general design. You can write custom html templates and pass them to the `template` YAML option. The output format works the same as `tailwindr::tailwind_prose` but doesn't include Tailwind Typography. \n\n## Credits\n\n- [TailwindCSS](https://tailwindcss.com/) and [Tailwind Typography](https://github.com/tailwindlabs/tailwindcss-typography)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkylebutts%2Ftailwindr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkylebutts%2Ftailwindr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkylebutts%2Ftailwindr/lists"}