Hello, Semantic-UI community!
Question 1: How is the correct flow to extend the Semantic UI with a new component? The "Menu" and "Sidebar" components are not suitable for my case, so I tried to find a documentation about creating new components, but no lucky! If there is no docs for that, I suggest to create it. Or this is not the way you are working?
Question 2: As said, I am trying to create a custom "navbar" component that fits my case (there is no component with this name, so I used it).
/src/definitions/ezaca/navbar.less inspired by button.lesstasks/config/defaults.js to include my navbargulp build worked, but my component was not included.
tasks/config/admin/realease.js with a list of components. Same result!tasks/config/project/install.js with the list of components I selected in the custom installation, so I added { name: "navbar", checked: true }gulp build worked, but my component is never included.
I have tested other places, but it seems I have changed the entire Semantic project, but my file keeps being cruelly ignored. After some hours I realized I'm stuck and on need of community help.
How should I include a custom component in Semantic UI?
Thanks,
Eliakim.
Hi @ezaca, take a look at Semantic-UI#4212 that adds a component, the list of changed files should give you an idea on what needs to be changed or added.
I have started a clean install. Now I added "bacon" in "elements", because Semantic loves bacon, for sure!
(And it will be side-by-side to "button" element).
gulp build to build the new install.src/definitions/elements/bacon.less (copied from button.less)src/site/elements/bacon.overrides and bacon.variables (empty)src/themes/default/elements/bacon.overrides and bacon.variables (empty)src/semantic.less to import bacon (line duplicated from button)src/theme.config to include bacon (line duplicated from button)/tasks/config/admin/release.js to include bacon/tasks/config/project/install.js to check bacon/tasks/config/defaults.js to include bacongulp build again.dist/components/bacon.*OK. That's it! I think I have messed the things with the previous trial. It worked!
This is the step-by-step to include CSS (Javascript requires one more step on globals to load).
But steps 3 and 4 are optional. I don't know if there are more optional steps, but it seems that everyone have their own jobs.
I hope this helps others with the same problem (and to build the docs)!
Thank you for the help, Banandrew!
(Powered by Google Translator :D )
Hmmmm, I think I got something here, but I don't know what it could be!
When I make an automatic installation, everything works perfectly, like I said before!
But I have chosen the custom setup and repeated the process, plus adding the component to semantic.json, and the custom component is not generated after build...
Some hint?
@ezaca I follow your step but still not working.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.
@ezaca Thank you for instructions, I adjusted files in the same way and my new component is created and CSS added to semantic.css.
Most helpful comment
I have started a clean install. Now I added "bacon" in "elements", because Semantic loves bacon, for sure!
(And it will be side-by-side to "button" element).
gulp buildto build the new install.src/definitions/elements/bacon.less(copied from button.less)src/site/elements/bacon.overridesandbacon.variables(empty)src/themes/default/elements/bacon.overridesandbacon.variables(empty)src/semantic.lessto import bacon (line duplicated from button)src/theme.configto include bacon (line duplicated from button)/tasks/config/admin/release.jsto include bacon/tasks/config/project/install.jsto check bacon/tasks/config/defaults.jsto include bacongulp buildagain.dist/components/bacon.*OK. That's it! I think I have messed the things with the previous trial. It worked!
This is the step-by-step to include CSS (Javascript requires one more step on globals to load).
But steps 3 and 4 are optional. I don't know if there are more optional steps, but it seems that everyone have their own jobs.
I hope this helps others with the same problem (and to build the docs)!
Thank you for the help, Banandrew!
(Powered by Google Translator :D )