mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
More tests for CSS transformer
This commit is contained in:
parent
16fe9090a5
commit
90020202f0
@ -35,11 +35,11 @@ class TestTransform(SimpleTest):
|
|||||||
s('@im/* c */port "x.y";', '@import "X.Y";')
|
s('@im/* c */port "x.y";', '@import "X.Y";')
|
||||||
s('@import url("narrow.css") supports(display: flex) handheld and (max-width: 400px);',
|
s('@import url("narrow.css") supports(display: flex) handheld and (max-width: 400px);',
|
||||||
'@import url("NARROW.CSS") supports(display: flex) handheld and (max-width: 400px);')
|
'@import url("NARROW.CSS") supports(display: flex) handheld and (max-width: 400px);')
|
||||||
s('@import url( x.y);', '@import url("X.Y");')
|
s('@import url( x/*a*/.y);', '@import url("X.Y");')
|
||||||
|
|
||||||
u('background: url( te st.gif ) 12; src: url(x)', 'background: url("TE ST.GIF") 12; src: url("X")')
|
u('background: url( te st.gif ) 12; src: url(x)', 'background: url("TE ST.GIF") 12; src: url("X")')
|
||||||
u('background: url(te/**/st.gif); xxx: url()', 'background: url("TEST.GIF"); xxx: url()')
|
u('background: url(te/**/st.gif); xxx: url()', 'background: url("TEST.GIF"); xxx: url()')
|
||||||
u(r'background: uRl(t\)est.gif)', 'background: url("T)EST.GIF")')
|
u(r'background: uRl(t\)e/st.gif)', 'background: url("T)E/ST.GIF")')
|
||||||
u('a:url( "( )" /**/ )', 'a:url("( )")')
|
u('a:url( "( )" /**/ )', 'a:url("( )")')
|
||||||
u('a:url( "(/*)" )', 'a:url( "(/*)" )', url_callback=lambda x: x)
|
u('a:url( "(/*)" )', 'a:url( "(/*)" )', url_callback=lambda x: x)
|
||||||
|
|
||||||
@ -60,18 +60,18 @@ class TestTransform(SimpleTest):
|
|||||||
d('xxx:yyy', 'xxx:yyy')
|
d('xxx:yyy', 'xxx:yyy')
|
||||||
|
|
||||||
sheet = '''
|
sheet = '''
|
||||||
@import "loc.test";
|
@import "b/loc.test";
|
||||||
@media screen {
|
@media screen {
|
||||||
font: 16px calc(20vw - 30rem);
|
font: 16px calc(20vw - 30rem);
|
||||||
|
|
||||||
.cls {
|
.cls {
|
||||||
color: red;
|
color: red;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
background: url("loc.test")
|
background: url("b/loc.test")
|
||||||
}
|
}
|
||||||
|
|
||||||
#moo.cat {
|
#moo.cat {
|
||||||
x: url("loc.test")
|
x: url("b/loc.test")
|
||||||
}
|
}
|
||||||
|
|
||||||
@zoo {
|
@zoo {
|
||||||
@ -82,4 +82,4 @@ class TestTransform(SimpleTest):
|
|||||||
}
|
}
|
||||||
.why { font: 16px}
|
.why { font: 16px}
|
||||||
'''
|
'''
|
||||||
s(sheet, sheet.replace('16px', '1rem').replace('loc.test', 'LOC.TEST'))
|
s(sheet, sheet.replace('16px', '1rem').replace('b/loc.test', 'B/LOC.TEST'))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user