Advertisement
adolphuZ

Untitled

Jun 5th, 2024
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.86 KB | None | 0 0
  1. class HtmlElementDecorator(HtmlElement):
  2.     def __init__(self, element):
  3.         self.element = element
  4.  
  5.     def render(self):
  6.         return self.element.render()
  7.  
  8. class StyledDiv(HtmlElementDecorator):
  9.     def render(self):
  10.         return "<div class='styled-div'>" + self.element.render() + "</div>\n"
  11.  
  12. class StyledLabel(HtmlElementDecorator):
  13.     def render(self):
  14.         return "<label class='styled-label'>" + self.element.render() + "</label>\n"
  15.  
  16. class StyledInput(HtmlElementDecorator):
  17.     def render(self):
  18.         return "<input class='styled-input' type='text'/>\n"
  19.  
  20. class StyledSelect(HtmlElementDecorator):
  21.     def render(self):
  22.         return "<select class='styled-select'><option>Option</option></select>\n"
  23.  
  24. class StyledSubmit(HtmlElementDecorator):
  25.     def render(self):
  26.         return "<input class='styled-submit' type='submit'/>\n"
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement