From c2d3b22c2d890cb174159ef999308970b2e9ce81 Mon Sep 17 00:00:00 2001
From: prndev <prndev@users.noreply.github.com>
Date: Thu, 4 Jan 2018 19:46:31 +0100
Subject: [PATCH] Fixed vector art stylesheet generation.

In alignment with SugarCube changes in dbb715d.
As proposed by @t3431710.
Closes #32.
---
 src/art/vector/Generate_Stylesheet.tw | 46 +++++++++++++--------------
 1 file changed, 22 insertions(+), 24 deletions(-)

diff --git a/src/art/vector/Generate_Stylesheet.tw b/src/art/vector/Generate_Stylesheet.tw
index b66f2dbd0c0..087e9e3bc0f 100644
--- a/src/art/vector/Generate_Stylesheet.tw
+++ b/src/art/vector/Generate_Stylesheet.tw
@@ -1,6 +1,6 @@
 :: Art_Vector_Generate_Stylesheet_ [nobr]
 
-/* _art_display_class is a workaround for browsers not supporting scoped styles */
+/* _art_display_class is the style class for this display */
 <<if _art_display_id > 0 >>
 	<<set _art_display_id += 1>>
 <<else>>
@@ -8,9 +8,7 @@
 <</if>>
 <<set _art_display_class = "ad"+_art_display_id >>
 
-/* this scoped style sets the colours for this display only */
-<style scope>
-._art_display_class {
+<<print "<style>."+_art_display_class+" {
     position: absolute;
     height: 100%;
     margin-left: auto;
@@ -18,23 +16,23 @@
     left: 0;
     right: 0;
 }
-._art_display_class .white   { fill:#FFFFFF; }
-._art_display_class .skin    { fill:_skinColour; }
-._art_display_class .head    { _headSkinStyle }
-._art_display_class .torso   { _torsoSkinStyle }
-._art_display_class .boob    { _boobSkinStyle }
-._art_display_class .penis   { _penisSkinStyle }
-._art_display_class .scrotum { _scrotumSkinStyle }
-._art_display_class .areola  { _areolaStyle }
-._art_display_class .labia   { _labiaStyle }
-._art_display_class .hair    { fill:_hairColour; }
-._art_display_class .shoe    { fill:_shoeColour; }
-._art_display_class .shoe_shadow    { fill:_shoeShadowColour; }
-._art_display_class .smart_piercing { fill:#4DB748; }
-._art_display_class .steel_piercing { fill:#787878; }
-._art_display_class .steel_chastity { fill:#BABABA; }
-._art_display_class .outfit_base  { fill:_outfitBaseColour; }
-._art_display_class .gag     { fill:#BF2126; }
-._art_display_class .shadow  { fill:#010101; }
-._art_display_class .glasses { fill:#010101; }
-</style>
+."+_art_display_class+" .white   { fill:#FFFFFF; }
+."+_art_display_class+" .skin    { fill:"+_skinColour+"; }
+."+_art_display_class+" .head    { "+_headSkinStyle+"; }
+."+_art_display_class+" .torso   { "+_torsoSkinStyle+"; }
+."+_art_display_class+" .boob    { "+_boobSkinStyle+"; }
+."+_art_display_class+" .penis   { "+_penisSkinStyle+"; }
+."+_art_display_class+" .scrotum { "+_scrotumSkinStyle+"; }
+."+_art_display_class+" .areola  { "+_areolaStyle+"; }
+."+_art_display_class+" .labia   { "+_labiaStyle+"; }
+."+_art_display_class+" .hair    { fill:"+_hairColour+"; }
+."+_art_display_class+" .shoe    { fill:"+_shoeColour+"; }
+."+_art_display_class+" .shoe_shadow    { fill:"+_shoeShadowColour+"; }
+."+_art_display_class+" .smart_piercing { fill:#4DB748; }
+."+_art_display_class+" .steel_piercing { fill:#787878; }
+."+_art_display_class+" .steel_chastity { fill:#BABABA; }
+."+_art_display_class+" .outfit_base  { fill:"+_outfitBaseColour+"; }
+."+_art_display_class+" .gag     { fill:#BF2126; }
+."+_art_display_class+" .shadow  { fill:#010101; }
+."+_art_display_class+" .glasses { fill:#010101; }
+</style>" >>
-- 
GitLab