[4.0] Custom select SVG improvements#28755
[4.0] Custom select SVG improvements#28755C-Lodder wants to merge 4 commits intojoomla:4.0-devfrom C-Lodder:custom-select
Conversation
|
Thank you |
|
Will test tomorrow. |
|
The styling can be argued about in someone elses PR/issue. Would like to keep this purely about the SVG issue |
|
I have mixed feelings here.
|
The only thing you need to be testing is:
|
For my info: can you give me an example of a scss that would override the variable when we need the svg to be white on a different background like Published/Unpublished (Greeen/Red) |
|
@infograf768 Oh I see what you mean. If Atum was using PostCSS, this would easily be possible with scoped variables. With SCSS, I think you'd have to create a mixin. Again, styling changes like the select BG colour are opinion based and are not part of this PR's scope. It can be argued about somewhere else. |
|
Therefore, the only solution would be to create a new variable with a white filled svg and 2 new variables to use it in ltr/rtl? |
|
That would basically just make this PR pointless. You would need to extended the changes done in this and use a mixin instead. |
|
@C-Lodder the recommendation is that you shouldn't ever hardcode the fill in the svg so you can control it (class/inline css/whatever). So I guess you could remove the hardcoded bit from the svg part and add a |
|
@dgrammatiko You cannot use CSS's |
|
Then use css custom properties 😉 |
|
You can't do interpolation with a background Using SCSS will require a mixin or a bunch of additional variables |
Am I correct? The main problem is that we don't use inline SVGs? |
|
You can't use inline SVG's within a You've got 5 options that I can think of:
|
|
is it really impossible to use icons? |
|
@infograf768 |
|
Then let's use caret. Easy enough to change color |
|
If you wish to use triangles instead chevrons then this change should be done across the entire UI, something well beyond the intended scope of this PR. |
|
I have tested this item ✅ successfully on 03816b9 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28755. |
|
I was just about to see how everything could be switched to FontAwesome. (I just wanted to get some experience.) And now I believe that we should first standardize the HTML markup. There are many different ways in which the select fields are inserted. @C-Lodder When integrating with choices, your PR no longer shows an icon. I don't understand why position is integrated with choices and status doesn't. Am I missing something? Both are single selects. What do you think: shouldn't we first standardize the basis (HTML) and then build the CSS (SCSS) cleanly on it? Regardless of whether we use (inline) SVG or FontAwesome. |
|
@astridx ChoicesJS styling is fixed. The HTML is already standardised. It's just a simple Probably just easier to remove the |
Standardizes is a relative expression :) Why for position and for published Because of these differences (in one case joomla-field-fancy-select and in the other case not), it happened in my tests that the icon at position disappeared - just like yours in this PR. I expected that a select in which only one selection is possible would be the same everywhere. |
|
@astridx choicesJS is used where we need to select multiple AND/OR where we need to create on the fly eg a category or position |
|
Thanks @brianteeman, I haven't seen that before. No I understand: Position is created with choicesJs because you can create position. |
|
@C-Lodder mate why did you close this one? |
|
Closing as it's being done here: #28787 |
|
@C-Lodder I saw it: hardcoding Font Awesome to all the select elements? What could possible go wrong there... |






Pull Request for Issue #28463
Summary of Changes
Fix the styling issues present with the current
custom-select.Testing Instructions
node build.js --compile-cssfrom your terminaldir="ltr"withdir="rtl"on the<html>node.Screenshot