ui5-webcomponents icon indicating copy to clipboard operation
ui5-webcomponents copied to clipboard

Whats the difference between fundamental and ui5 webcomponents?

Open itflies opened this issue 7 years ago • 5 comments

Hi there

Just stumbled over https://github.com/SAP/fundamental

Maybe a stupid question but:

Whats the difference and why is it there? (looks like the future are webcomponents so i don't get the idea behind fundamental)

Hope somebody can clarify :)

itflies avatar Jul 19 '19 11:07 itflies

Hey @itflies

Fundamentals is a set of stylesheets along with a recommendation how the HTML has to look in order to be styled correctly by that CSS. It is your task to write that HTML, it is your task to update the HTML as the user interacts with it.

UI5 Web Components, on the other hand, encapsulate not only the design, but also the structure and the functionality inside new HTML elements you can use like any other HTML elements without caring about how they work internally.

So all in all, UI5 Web Components are fully functional UI controls, usable like regular HTML tags, while Fundamentals is focusing on the design and leaving you all the freedom to implement the functionality to the degree needed.

There is some activity from Fundamental implementing Angular, React and Vue components which take care of the behavioural part and producing the HTML. While we cannot comment their current status, they would of course ease the consumption when you use one of these frameworks. If new frameworks should arise, components for those frameworks could be created as well (not to mention the repeated implementation effort for each framework).

The UI5 Web Components, on the other hand, are independent of specific frameworks, so the one existing implementation can be used in any (also future) framework because what they all do in the end is: working with HTML.

Regards, Martin

MapTo0 avatar Jul 19 '19 11:07 MapTo0

Hi Martin

Thanks for your comprehensive answer, appreciated.

This still leaves me with a feeling that at least the efforts for making the ui look consistent when used in different frameworks are doubled somehow.

I could see that if ui5 webcomponent has a missing feature it could be implemented as a workaround using fundamental library but that means pulling in more dependencies which i don't like.

anyways, thanks again for clarifying

itflies avatar Jul 19 '19 12:07 itflies

Hello @MapTo0

I'm trying to use the css styles from Fiori Fundamentals in the ui5 componentes. In this case I would like to have inputs smallers using the next style from Fiori Fundamentals: class="fd-input--compact fd-form__control" or others styles in other components

¿Is it Possible? ¿What do you recommend in styles? ¿Is it possible to use both at the same time?

Thank you

andresfelipe66 avatar Jul 25 '19 15:07 andresfelipe66

Hello @andresfelipe66

You should be able to style any of the ui5-webcomponents based as you do with normal DOM elements. Re are currently improving that and you can check some of the changes mentioned in https://github.com/SAP/ui5-webcomponents/issues/328#issuecomment-514534469 (not yet released, hopefully soon).

If you want to make the input smaller as you said, why don't you just configure the web components to compact size?

<script data-ui5-config type="application/json">
{
  "compactSize": true
}
</script>

MapTo0 avatar Jul 25 '19 16:07 MapTo0

Hello @MapTo0

Thanks for the answer, I'm trying with the compactSize. It works well sending in the url (http://localhost:4300?sap-ui-compactSize=true)... But. I'm working in angular... Do you know in what file I could define this behaviour for alla application or for each component? I have tried in index.html and in the componente directly..

Thank you

andresfelipe66 avatar Jul 25 '19 19:07 andresfelipe66