Replies: 1 comment 1 reply
-
What would be the output of the research RFC? What are the criteria that can guide you in making this decision? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Quick preface
As of 2020, Kendo UI components are quite monolithic in terms of themes e.g. a component always has a given set of visual properties for a single theme and there are no modifiers. Yes, developers can customize the themes, but they still end up with the same rigid and monolithic components.
A button, for instance, is always has a certain rounded border; a certain set of dimensions; a certain font size ... The only exception is that our image buttons are square and our primary buttons are with a different color. We did try to make things a bit more flexible with our
look
property that added some much needed variations, but that was not enough and couldn't be applied to all components.And thus we reach the current discussion...
In order to customize components better we can break up our monolithic approach to a more granular one: instead of a single class applying everything, let's go with
k-button
forkendo-button
, we can have modifiers that apply very few properties. We've grouped characteristics / modifiers in the following categories:And I will go into more details.
Shape
While many shapes are quite possible with CSS, not all of them are applicable, usable or make sense. Do we really need a triangle button, or star shaped grid?
As of now, shape, to us, specifies the roundness (border radius) of a component and the ratio between width and height:
As of 2020 element aspect ratio is not supported so square and circle shapes have hard-coded dimensions. If a component has any other shape it may grow horizontally and / or vertically.
Size
The dimensions of a component are the sum of border width, padding and content. Any naming may do, but we've boiled them to the following:
Apart from border width, padding, font size and line-height, sizes also control border-radius.
Theme color
Brings the color factor in the components. Looking at our themes we've decided to have our main theme colors, plus our important colors as options:
There are also three special options:
There are two other cases we should consider
Fill
Imagine the following:
They are both red, right! Fill mode specifies how a color is applied to a component:
Rendering
Each modifier should be applied via a class that has the component name e.g.:
k-textbox-lg
denotes a large textbox componentk-badge-inverse
denotes a badge with inverse theme colorThere is one issue with this approach though, considering that all props are in fact either enums or string, there will be no visual difference between a button with size
primary
and theme colorsmall
and a button with sizesmall
and theme colorprimary
.One way we could tackle this is to use compound class names:
k-component-shape-size
:k-button-rounded-sm
,k-input-sqare-lg
...k-component-fill-color
:k-input-solid-primary
,k-button-outline-inverse
...That in terms leaves another question: what if we want a value to be "auto" i.e. not specified and left for customization? What if two values are "auto"?
Beta Was this translation helpful? Give feedback.
All reactions