Overview
Webite: https://rfui.deno.dev/
This is a component library that is currently intended to be used on projects using Denoâs web framework Fresh and is built according to the following philosophical principles.
- Opinionated
- Scale down
- Limit your choices
- Prioritize documentation
- Pit of success (eg. by providing tips and references to best practices, and by prefixing with underscores)
- Pretty
- Use the platform
- Pareto solutions > high customizability
Notes
Early stage
It is currently in a very early stage. See the project page.
Atomic Design
It follows the Atomic Design Methodlogy by breaking components into âatomsâ, âmoleculesâ and âorganismsâ.
Syntax Highlighting
If users want CodeBlock
to have syntax highlighting, theyâll have to use
Prism. Hereâs what that involves:
- Generate a
prism.js
andprism.css
file here. Make sure you include whatever languages and plugins you need. Ie. if you want to let users copy the code to their clipboard, youâll need to include the âCopy to Clipboard Buttonâ plugin. - If you want stuff in code blocks to wrap, change
white-space:pre
inprism.css
towhite-space:pre-wrap
. - Load them with something like
<script src="/prism.js"></script>
and<link rel="stylesheet" type="text/css" href="/prism.css" />
. - After your JavaScript has loaded you (might?) need to call
Prism.highlightAll();
. One way to do this is to include<script>Prism.highlightAll();</script>
right before</body>
.
Islands in docs
Most docs pages use ComponentDocsPage
from
/islands/demo/component-docs-page.tsx
. However, when docs pages need to be
interactive â ie. because the component theyâre documenting is an island â
using ComponentDocsPage
wonât work because you
canât pass functions into an island
(see also this GitHub issue).
I also tried refactoring ComponentDocsPage
to accept the current props as
children
instead, but that didnât work for reasons I donât understand.
So then, I was forced to be pretty WET (instead of DRY) in the docs pages for components that are islands.
Releasing
Versioning
To create a new version of this library:
- Use https://github.com/adamzerner/rfui/releases/new
- Update CHANGELOG.md
- Follow semantic versioning
Generating the Tailwind CSS file
Iâve tried to find a good terminal command or script to run but havenât found anything good, and it doesnât seem worth spending more time looking.
So hereâs the process.
- Go to
tailwind.config.ts
and removeroutes
since that directory is just for the documentation, not for code that will be used by library users. - Run
deno task start
. - In Firefox, open the dev tools, click the âStyle Editorâ tab, and refer to
app.css
. Thatâs the file that users of the library will need. - Update
static/rfui.css
.