Ejemplo n.º 1
0
 def _get_expression(self):
     expressions = []
     if self.min:
         expressions.append('(min-width:%s)' % TX.px(self.min))
     if self.max:
         expressions.append('(max-width:%s)' % TX.px(self.max))
     if self.device or expressions:
         return (self.device or 'all') + ' and ' + ' and '.join(expressions)
     return None  # Raising error, style as media needs a defined expression
Ejemplo n.º 2
0
 def _get_expression(self):
     expressions = []
     if self.min:
         expressions.append('(min-width:%s)' % TX.px(self.min))
     if self.max:
         expressions.append('(max-width:%s)' % TX.px(self.max))
     if self.device or expressions:
         return (self.device or 'all') + ' and ' + ' and '.join(expressions)
     return None # Raising error, style as media needs a defined expression
Ejemplo n.º 3
0
def asValue(value):
    if isinstance(value, Value):
        return value.value
    return TX.px(value)
Ejemplo n.º 4
0
def asValue(value):
    if isinstance(value, Value):
        return value.value
    return TX.px(value)