Skip to content

Commit

Permalink
style: allow modifying width of normal and hovered stroke lines
Browse files Browse the repository at this point in the history
  • Loading branch information
invisiblek committed Jul 27, 2017
1 parent 9feda56 commit 51a96d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pygal/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
{{ id }}.reactive {
fill-opacity: {{ style.opacity }};
stroke-opacity: {{ style.stroke_opacity }};
stroke-width: {{ style.stroke_width }};
}

{{ id }}.ci {
Expand All @@ -104,7 +105,7 @@
{{ id }}.active .reactive {
fill-opacity: {{ style.opacity_hover }};
stroke-opacity: {{ style.stroke_opacity_hover }};
stroke-width: 4;
stroke-width: {{ style.stroke_width_hover }};
}

{{ id }}.ci .reactive.active {
Expand Down
2 changes: 2 additions & 0 deletions pygal/style.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ class Style(object):
opacity_hover = '.8'

stroke_opacity = '.8'
stroke_width = '1'
stroke_opacity_hover = '.9'
stroke_width_hover = '4'

transition = '150ms'
colors = (
Expand Down

1 comment on commit 51a96d3

@cbeytas
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't stroke_width here break the stroke_style configuration option for serie?
It applies the style directly to the <path> element, overriding any 'width' specified with stroke_style (which is applied to the <g> containing the path).
Using stroke_style seems to be the better way to do this, that way you can control the stroke width for each serie independently and it doesn't apply to the legend boxes as well.

Please sign in to comment.