-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[UX] Improve labels system #13689
base: 5.x
Are you sure you want to change the base?
[UX] Improve labels system #13689
Conversation
Mautic has been using primary, success and warning to color these stats. Changed to something neutral.
585ac20
to
419e14e
Compare
Mautic has been using primary, success and warning to color these stats. Changed to something neutral.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion on the rounding of corners more uniformly. I'm on the fence as to whether rounding is preferential to squared corners, but putting that to the side, some general points I noticed:
I think these should be centre aligned instead of left? In both Contact and Companies list view.
Also on contact profiles in the tabs:
Also, the tag text seems a bit misaligned with the closing cross icon? (May have always been like this but I notice it more with the rounding)
I noticed that form results still seem to use the old style:
Also landing pages is the same:
I found this random blob of colour which I first noticed in points triggers (which I found represented the contact colour) quite confusing, as it was almost like it was meant to be a label (given its shape) but there was no text. Maybe this shouldn't be rounded? I feel the same about the Categories list, given there's no column header in either view it's a bit ... weird?
Tasks
|
@andersonjeccel It would be best to prevent line breaks within individual tags, eg. using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a comment to one of the committed files. Basically, some of the labels in cells do have white-space: nowrap
, other do not. Would be best to check all the twig files with labels in cells, and fix the ones that are missing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While testing this, I found an issue with the Lead and Segment listing pages. The problem is that the action drop-down disappears when selecting all or a few from the list. Here is the short video as well: @andersonjeccel, I'm not sure where to post this issue, as it was not there on the |
@shinde-rahul This disappearing bug is fixed on another PR, I’ll mention you there! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A thing that's been bothering me, is the structure and naming of the css classes. These should be named after their function (as design systems usually do), rather than the style they add. Eg. before this, you had a base class 'label' and variants were something like 'label-danger' because it suggests a level of importance.
Using colors for names, makes it impossible to later introduce any kind of customization or even making a dark theme version without either mis-naming the colors, or having to replace the color property in all elements that use that variable instead of just changing the value of the css-variable.
The order of the words is also important, as you should be going from most generic/general, to least generic (eg. inlabel-danger
, the variant goes at the end and the standard name at the beginning). Consistency like this is important.
So I suggest looking at how many variants there are, what their purpose is and thinking of (simplified) functional variant names as much as possible. Depending on how complex the variants are, it could just be tag tag-01
tag tag-02
etc… but it could be more descriptive (like levels of importance eg. tag-level-1
). It could be the tags are named after their source eg. tag-contacts
tag-segments
and so on.
Looking at the CSS variables, there's a dozen color variants, which seems like a lot. If you really need a rainbow of colors, you would use 2 lists:
- generic color names, eg.
color-teal
color-teal-border` etc… - the tag referencing variables eg.
--tag-contacts
or--tag-level-01
, which then references to the generic color variable:var(--color-teal)
. You can be even more generic, if the same color is used on a lot of elements. Eg. in the past, I've usedcolor-primary
andcolor-secondary
when working with a stylguide. But depends on how many variants you have of course. Could just be numbered or named after something else.
That way, you can easily override just the tag variable when a color change is needed and don't have to touch the color variables. Eg. if you have a dark theme, and there is a dark blue tag that needs to be light blue or an entirely different color, you change the color reference in the tag variable:--tag-contacts: var(--color-dark-blue)
becomesvar(--color-light-blue)
.
@LordRembo Since this PR extends the labels system, it's adding exclusively 2 enhancements:
Regarding light/dark theme, these variables are magical. Light theme, the default look:
Dark theme, which can be set appending
This can be achieved through JS by watching a button for click event, then appending the attribute and saving the user preference on the browser's local storage. All variables have the same name on both themes, but since the The approach above is what makes the dark theme possible while keeping the cleanest code possible, so you don't need to modify the tag variable when a color change is needed and also don't have to touch the color classes, only add the attribute to the HTML and the CSS system will do everything for you, automatically, on literally the entire interface. What do you think about this perspective? |
Now it's working, forgot to change classes after Rembrand request, sorry |
@andersonjeccel I can see how you'd change specific colors based on, for example, there being a dark mode, that's fine. The situation that this does not address, is if these colors don't exist in a variant or rebranded theme. Example:
Using color-named variables and color-named classes to style elements directly is asking for trouble. If anyone starts customizing themes (eg. branding a Mautic for Coca Cola, for example), and they don't use blue, you need to either rename the classes and the variables, or set colors that don't match the name. (eg.
By default, that border color, could be blue, so you have this in You can still maintain a long list of color variables to use, but you need another variable inbetween the original color and the class it will be used in, that has a more generic or functional name. And similarly, you should have a functional class name. Right now you have about 4 or so label classes that are actually in use, so I'd suggest renaming those to be functional/generic and using 'intermediate' variables names, as I explained. All the other label classes that are not in use, can be removed. Keep the color variable names for use when new (functional) class names are needed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment above
@LordRembo now I got what you mean I’ll commit a fix soon |
Description:
This PR adds a set of new tags/label styles for devs to use while building new features.
It also changes some labels to avoid primary, warning and success being used where they are inadequate.
These tags have hover effect to improve user experience.
Aiming to provide consistency, I also added an operational tag to be triggered when .has-click-event is being used. This way, clickable tags will have a darker border color to indicate for users that they're interactive.
(company score was just the number, no styles before)
chosen (library) now follow a standard, which indicates these labels are selectable/in the context of filtering options
Steps to test this PR: