Contributing
Find an bug or have an idea? Create an issue on GitHub.
drab is licensed under the MIT License.
Since this is a headless library, simple elements like a badge that can be easily created with HTML and CSS are not included in the JavaScript library, there are references to CSS only elements in the styles section.
Local development
This library is built with TypeScript, the documentation site is built with Vite.
To set up your development environment locally you’ll need to have NodeJS installed on your computer. Then follow these steps:
- Clone the repository.
- Install dependencies with npm.
- Start the development server, this will start
tsc
andvite dev
together when run from the root directory.
bash
git clone https://github.com/rossrobino/drab.git
cd drab
npm i
npm run dev
Making changes
- Each element is housed in
packages/drab/src/
—in most cases, each element extends a combinations of mixins fromdrab/base
. - Each element also has a
define.ts
file where it is imported and defined. - Examples demos are contained in
apps/docs/pages/
. - For new elements:
- Export the element from
packages/drab/src/index.ts
. - Import the
define
module inpackages/drab/src/define.ts
. - Add the element’s attribute types to
packages/drab/src/types/index.ts
. - Add the element’s entry points to
package.json
.
- Export the element from
- Run
npm run doc
to document your element with TypeDoc. - Run
npm run build && npm run preview
to verify your build.