From 7fe0380d7d4055f77276e77e9f2a2ec7a0b0f7f6 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Mon, 4 Feb 2019 13:01:35 -0500 Subject: [PATCH] Make sure icon fill colors can be overridden --- css/80_app.css | 4 ++++ modules/svg/defs.js | 4 ++++ modules/svg/improveOSM.js | 4 +--- modules/svg/notes.js | 4 ++-- modules/ui/improveOSM_header.js | 1 + modules/ui/note_header.js | 2 +- 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/css/80_app.css b/css/80_app.css index 5c0e52702..d549333d5 100644 --- a/css/80_app.css +++ b/css/80_app.css @@ -409,6 +409,10 @@ button[disabled].action:hover { border-radius: 3px; } +.icon-annotation { + color: #333; +} + /* Toolbar / Persistent UI Elements ------------------------------------------------------- */ diff --git a/modules/svg/defs.js b/modules/svg/defs.js index 47d9722a5..b79c65e9b 100644 --- a/modules/svg/defs.js +++ b/modules/svg/defs.js @@ -199,6 +199,10 @@ export function svgDefs(context) { node.appendChild( d3_select(svg.documentElement).attr('id', d).node() ); + if (d !== 'iD-sprite') { // allow icon colors to be overridden.. + d3_select(node).selectAll('path') + .attr('fill', 'currentColor'); + } }); }); }; diff --git a/modules/svg/improveOSM.js b/modules/svg/improveOSM.js index b9881ff29..2d045e678 100644 --- a/modules/svg/improveOSM.js +++ b/modules/svg/improveOSM.js @@ -143,7 +143,7 @@ export function svgImproveOSM(projection, context, dispatch) { markersEnter .append('use') .attr('transform', 'translate(-5.5, -21)') - .attr('class', 'icon') + .attr('class', 'icon-annotation') .attr('width', '11px') .attr('height', '11px') .attr('xlink:href', function(d) { @@ -194,8 +194,6 @@ export function svgImproveOSM(projection, context, dispatch) { function sortY(a, b) { return (a.id === selectedID) ? 1 : (b.id === selectedID) ? -1 - : (a.severity === 'error' && b.severity !== 'error') ? 1 - : (b.severity === 'error' && a.severity !== 'error') ? -1 : b.loc[1] - a.loc[1]; } } diff --git a/modules/svg/notes.js b/modules/svg/notes.js index d49fb3223..14e42c87d 100644 --- a/modules/svg/notes.js +++ b/modules/svg/notes.js @@ -143,11 +143,11 @@ export function svgNotes(projection, context, dispatch) { .attr('y', '-22px') .attr('xlink:href', '#iD-icon-note'); - notesEnter.selectAll('.note-annotation') + notesEnter.selectAll('.icon-annotation') .data(function(d) { return [d]; }) .enter() .append('use') - .attr('class', 'note-annotation') + .attr('class', 'icon-annotation') .attr('width', '10px') .attr('height', '10px') .attr('x', '-3px') diff --git a/modules/ui/improveOSM_header.js b/modules/ui/improveOSM_header.js index aa393b22b..3b1777755 100644 --- a/modules/ui/improveOSM_header.js +++ b/modules/ui/improveOSM_header.js @@ -57,6 +57,7 @@ export function uiImproveOsmHeader() { svgEnter .append('use') + .attr('class', 'icon-annotation') .attr('width', '11px') .attr('height', '11px') .attr('transform', 'translate(4.5, 7)') diff --git a/modules/ui/note_header.js b/modules/ui/note_header.js index c19338c49..59cccebde 100644 --- a/modules/ui/note_header.js +++ b/modules/ui/note_header.js @@ -35,7 +35,7 @@ export function uiNoteHeader() { iconEnter .append('div') .attr('class', 'note-icon-annotation') - .call(svgIcon(statusIcon, 'note-annotation')); + .call(svgIcon(statusIcon, 'icon-annotation')); }); headerEnter