From 5b2935f812dfabdb095b61709928fcf518f31709 Mon Sep 17 00:00:00 2001 From: Vincent Hardouin Date: Fri, 8 Mar 2024 23:14:34 +0100 Subject: [PATCH] refactor: move tooltip style in css file --- src/script.js | 6 ------ src/style.css | 10 ++++++++++ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/script.js b/src/script.js index 6d5b0ae..7b87515 100644 --- a/src/script.js +++ b/src/script.js @@ -35,12 +35,6 @@ window.addEventListener('resize', resizeMap); const tooltip = d3.select('body').append('div') .attr('class', 'tooltip') - .style('position', 'absolute') - .style('background-color', 'white') - .style('border', '1px solid black') - .style('padding', '5px') - .style('border-radius', '5px') - .style('visibility', 'hidden'); const addedStations = new Map(); const g = svg.append("g"); diff --git a/src/style.css b/src/style.css index 2915d72..dde96f0 100644 --- a/src/style.css +++ b/src/style.css @@ -17,4 +17,14 @@ svg { .end { color: #e52228; +} + +.tooltip { + position: absolute; + visibility: hidden; + padding: 0.5rem; + background-color: #fff; + border: 1px solid #000; + border-radius: 0.25rem; + color: #3b3d45; } \ No newline at end of file