-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change base-select icon from background-image to svg elements
Putting the svg in a data url for background-image was not as customizable in CSS for developers, but using an actual svg element is: openui/open-ui#881 Bug: 40146374 Fixed: 337904202 Change-Id: If1528b3df97e31de5b86b27a6aa935223ff0f0a4
- Loading branch information
1 parent
6813062
commit 57fe6fa
Showing
7 changed files
with
55 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
html/semantics/forms/the-select-element/stylable-select/resources/stylable-select-utils.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
function populateFallbackButtonIcon() { | ||
document.querySelectorAll('.stylable-select-button-icon').forEach(element => { | ||
element.innerHTML = | ||
`<svg viewBox="0 0 20 16" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||
<path d="M4 6 L10 12 L 16 6"></path> | ||
</svg>`; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
html/semantics/forms/the-select-element/stylable-select/select-icon-color-ref.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<!DOCTYPE html> | ||
<link rel=stylesheet href="resources/stylable-select-styles.css"> | ||
<script src="resources/stylable-select-utils.js"></script> | ||
|
||
<style> | ||
.stylable-select-button-icon svg { | ||
stroke: red !important; | ||
} | ||
</style> | ||
|
||
<div class=stylable-select-container> | ||
<button class=stylable-select-button popovertarget=popover id=button> | ||
<span class=stylable-select-selectedoption>option</span> | ||
<div class=stylable-select-button-icon></div> | ||
</button> | ||
</div> | ||
|
||
<script> | ||
populateFallbackButtonIcon(); | ||
</script> |
17 changes: 17 additions & 0 deletions
17
html/semantics/forms/the-select-element/stylable-select/select-icon-color.tentative.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!DOCTYPE html> | ||
<link rel=author href="mailto:[email protected]"> | ||
<link rel=help href="https://github.com/openui/open-ui/issues/881"> | ||
<link rel=match href="select-icon-color-ref.html"> | ||
|
||
<style> | ||
select { | ||
appearance: base-select; | ||
} | ||
select::select-fallback-button-icon { | ||
stroke: red; | ||
} | ||
</style> | ||
|
||
<select> | ||
<option>option</option> | ||
</select> |