Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CLI] cli command for design files #40

Closed
mauroerta opened this issue Jul 11, 2021 · 0 comments · Fixed by #83
Closed

[CLI] cli command for design files #40

mauroerta opened this issue Jul 11, 2021 · 0 comments · Fixed by #83
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@mauroerta
Copy link
Collaborator

Merge design files in the main theme

I think it could be useful in terms of developer experience to write the style of the components close to the component it self, for example:

-- src
-- -- components
-- -- -- MyComponent
-- -- -- -- MyComponent.tsx
-- -- -- -- MyComponent.morfeo.ts
-- -- -- -- index.ts

The content of MyComponent.morfeo.ts can be something like:

export default {
  tag: 'button',
  style: {
    bg: "primary",
    borderRadius: "m",
    px: "l",
   // ...
  },
  variants: {
    // ...
  },
}

Then, by running something like:

morfeo build-theme

The CLI will find all the {componentName}.morfeo.ts files and merge in the main theme:

// theme.ts
export default {
  colors: {....},
  spacings: {....},
  // ...
  components: {
    [componentName]: {
       // ... content from {componentName}.morfeo.ts
    }
  },
}
@mauroerta mauroerta added enhancement New feature or request help wanted Extra attention is needed labels Jul 11, 2021
@mauroerta mauroerta added this to the Morfeo CLI milestone Jul 11, 2021
@mauroerta mauroerta self-assigned this Aug 19, 2021
mauroerta added a commit that referenced this issue Sep 20, 2021
mauroerta added a commit that referenced this issue Sep 20, 2021
mauroerta added a commit that referenced this issue Sep 23, 2021
mauroerta added a commit that referenced this issue Sep 23, 2021
mauroerta added a commit that referenced this issue Sep 23, 2021
mauroerta added a commit that referenced this issue Sep 23, 2021
@mauroerta mauroerta mentioned this issue Oct 3, 2021
9 tasks
@mauroerta mauroerta linked a pull request Oct 3, 2021 that will close this issue
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant