dev-protocol / dev-protocol/hashi

[FEATURE] Make a true gradual adoption API

Open
#116 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request good first issue P3 public api proposal
Dominant language
SCSS
Stars
12
Forks
2
PR merge metrics
No merged PRs in 30d

Description

Detailed Description

Make the gradual adoption API more... well... gradual.
Let the design tokens be imported like querying a GraphQL API; Making it possible to just get the right amount of design tokens for a project.

Context

I saw this code snippet from the tailwind config of clubs.

// tailwind.config.js
const {
  theme: { colors, fontFamily },
} = require('@devprotocol/hashi/gradual')

And I thought it would be pretty cool if this sort of API was implemented first-class in the gradual adoption feature instead of making the code hacky.

Possible implementation

API Proposal:

const { colors, fontFamily } = require('@devprotocol/hashi/gradual');

Also, provide auto-completion through the Tailwind 3.1 types, or through custom JSDoc blocks, or through Typescript type declaration files.

Additional information

No response

Code of Conduct
  • I agree to follow this project's Code of Conduct

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the tailwind.config.js example and the @devprotocol/hashi/gradual import described in the issue. Compare the proposed destructured colors and fontFamily API with the existing gradual-adoption entry point, then define how token selection and autocomplete should work. Done means the first-class API and an autocomplete approach are specified and implemented.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, tailwindcss, typescript
Domain
design, frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.