Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

cssfilter.py: Add custom rules for text-shadow and box-shadow.

  • Loading branch information...
commit e2138ce61f907e40b1d90294c476ee86e01fe121 1 parent 0c2008e
@listen2 authored
Showing with 10 additions and 0 deletions.
  1. +10 −0 r2/r2/lib/cssfilter.py
View
10 r2/r2/lib/cssfilter.py
@@ -52,6 +52,9 @@
custom_macros = {
'bg-gradient': r'none|{color}|[a-z-]*-gradient\([^;]*\)',
'bg-gradients': r'{bg-gradient}(?:,\s*{bg-gradient})*',
+
+ 'single-text-shadow': r'({color}\s+)?{length}\s+{length}(\s+{length})?|{length}\s+{length}(\s+{length})?(\s+{color})?',
+ 'box-shadow-pos': r'{length}\s+{length}(\s+{length})?(\s+{length})?',
}
custom_macros = dict( #re-use macros from the library
@@ -71,6 +74,13 @@
'background': r'{bg-gradients}',
'background-image': r'{bg-gradients}',
+
+ # http://www.w3.org/TR/css3-text/#text-shadow
+ 'text-shadow': r'none|inherit|({single-text-shadow}{w},{w})*{single-text-shadow}',
+
+ # http://www.w3.org/TR/css3-background/#the-box-shadow
+ # (This description doesn't support multiple shadows)
+ 'box-shadow': 'none|inherit|(?:({box-shadow-pos}\s+)?{color}|({color}\s+?){box-shadow-pos})',
# old mozilla style (for compatibility with existing stylesheets)
'border-radius-topright': r'{border-radius-part}',
Please sign in to comment.
Something went wrong with that request. Please try again.