-
Notifications
You must be signed in to change notification settings - Fork 29
Add u-svg-inline-bg
mixin for inline SVG background
#938
Conversation
Buttons and Pagination use icons in buttons and Expendables use the up and
down chevrons in the Show/Hide label.
|
b0a28bb
to
be50dbe
Compare
So I wasn't thinking clearly here in respect to cf-buttons etc being installed in isolation, since there are no direct CSS dependencies within those packages, but rather depend on the convention of adding SVG markup within the component with the
Proposal: What if we converted all icons used within CF components to be inlined SVG in the CSS as data URLs. Here's a commit of what that would look like be50dbe |
Unsure if this would all work given LESS and how it handles variables, but if we go this route could we create the End result might be something like: |
14fa40a
to
aec76e0
Compare
u-svg-inline-bg
mixin for inline SVG background
7cfa3d1
to
af9e083
Compare
Okay I've totally re-worked this PR and rebased and force pushed, so throw out what you have and re-pull if checking this again. I realized we could use a custom less plugin to run JavaScript at build-time to inject the source SVG files inline into the background-image property via a mixin, which this PR adds. Icons are added two ways: in the markup + CSS styling, and purely via CSS as a background-image.
|
@anselmbradford: @caheberer and I took a look at this, and we're good replacing the custom up/down filled triangles with our standard up/down chevrons in sortable tables. Turns out the reason we didn't go with the chevrons originally was because the old chevrons were thinner and didn't have enough contrast in table headers. The recent re-draw of the icons fixes that issue, so it makes sense to get rid of that custom triangle icon. One issue we did notice is that the current chevron is sitting a little low in the cell, which is causing a couple of minor visual issues:
Can you vertically center the chevron with the cell's text? I did a quick mockup of that in Photoshop by pushing the chevron (both up and down states) up by 3px to get everything aligned (I added guides to the images to make it a little easier to eyeball things):
Once that alignment is fixed, this change looks a-ok from a design and UX perspective. Thanks! |
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.
Works as advertised, but a few necessary and a few optional changes to request. Going to test now in cfgov-refresh.
@Scotchester @niqjohnson Ready for review again. Thanks! |
@anselmbradford: The new alignment in the sortable tables looks perfect to me—thanks. I took a quick look at the other changes, too, and everything looked the same locally as in production (as expected). So this looks 👍 from the design and UX sides. |
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.
Looks good!
Additions
.u-svg-inline-bg( @name )
mixin and associated plugin.Removals
@cf-icon-path
variable.Changes
Testing
gulp build && gulp docs && bundle exec jekyll serve
should pass and launch the docs.Screenshots
Before:
After:
Notes