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
def asValue(value): if isinstance(value, Value): return value.value return TX.px(value)