Exemplo n.º 1
0
 def test_css_for_only_wrong_limit_key(self):
     css_class = 'padding-100-large-only'
     name = 'padding'
     value = px_to_em('100')
     expected = ''
     css_property = Property(name=name, value=value, priority='')
     breakpoint_parser = BreakpointParser(css_class=css_class, css_property=css_property)
     breakpoint_parser.limit_key = '-up'     # Change to WRONG LIMIT KEY
     css = breakpoint_parser.css_for_only()
     self.assertEqual(css, expected)
Exemplo n.º 2
0
 def test_css_for_only_general_usage(self):
     css_class = 'padding-100-large-only'
     name = 'padding'
     value = px_to_em('100')
     expected = (
         '@media only screen and (min-width: 45.0625em) and (max-width: 64.0em) {\n' +
         '\t.padding-100-large-only {\n' +
         '\t\tpadding: 6.25em;\n' +
         '\t}\n' +
         '}\n\n'
     )
     css_property = Property(name=name, value=value, priority='')
     breakpoint_parser = BreakpointParser(css_class=css_class, css_property=css_property)
     css = breakpoint_parser.css_for_only()
     self.assertEqual(css, expected)
Exemplo n.º 3
0
 def test_css_for_only_display_shorthand(self):
     css_class = 'large-only'
     name = 'display'
     value = 'none'
     expected = (
         '@media only screen and (max-width: 45.0625em) {\n' +
         '\t.large-only {\n' +
         '\t\tdisplay: none;\n' +
         '\t}\n' +
         '}\n\n' +
         '@media only screen and (min-width: 64.0em) {\n' +
         '\t.large-only {\n' +
         '\t\tdisplay: none;\n' +
         '\t}\n' +
         '}\n\n'
     )
     css_property = Property(name=name, value=value, priority='')
     breakpoint_parser = BreakpointParser(css_class=css_class, css_property=css_property)
     css = breakpoint_parser.css_for_only()
     self.assertEqual(css, expected)