示例#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
示例#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
示例#3
0
def asValue(value):
    if isinstance(value, Value):
        return value.value
    return TX.px(value)
示例#4
0
def asValue(value):
    if isinstance(value, Value):
        return value.value
    return TX.px(value)