riot-bootstrap
riot-bootstrap copied to clipboard
Namespace for components
Hello, I think components should have prefix like ui-
. Example: <ui-button>
, <ui-dropdown>
.
For separate riot-bootstrap and app components.
@jmas Namespace sounds good idea :) But honestly I prefer adding prefix to app components. Because I feel little bit too much... in such a case. Is there any good way?
Anyway, thanks for your feedback!
<ui-btn-group>
<ui-btn toggle="menu" option="primary">Primary <ui-caret /></ui-btn>
<ui-menu>
<ui-menu-item value="action">Action</ui-menu-item>
<ui-menu-item value="another">Another action</ui-menu-item>
<ui-menu-item value="something">Something else here</ui-menu-item>
<ui-menu-item value="separated">Separated link</ui-menu-item>
</ui-menu>
</ui-btn-group>
@cognitom Wouldn't the components in this library conflict with components of the same name in your application? Or with components with the same name in another library one might be using? It seems that component libraries ought to namespace the components they export to prevent collisions (example). In the case of this library, maybe a 'bs-' prefix would do. I do agree that it makes their usage look a little uglier, though.
@danny-andrews in my apps, all app-specific tags are named like below:
-
<layout-report>
,<layout-report-detail>
... -
<part-user>
,<part-article>
...
So basically, no conflict in my apps. But I totally agree your consideration. Maybe Riot should support a namespace feature in some way. At this point, I think we could generate bs-
prefixed version of this library, separately. Thoughts?