MCPcopy Create free account
hub / github.com/PageBot/PageBot / XXXbuild_scss

Method XXXbuild_scss

Lib/pagebot/elements/views/htmlview.py:30–44  ·  view source on GitHub ↗

Build the CSS for this document. Default behavior is to import the content of the file if there is a path reference, otherwise build the CSS from the available values and parameters in self.style and self.css().

(self, view, origin=None)

Source from the content-addressed store, hash-verified

28 return HtmlContext()
29
30 def XXXbuild_scss(self, view, origin=None):
31 """Build the CSS for this document. Default behavior is to import the
32 content of the file if there is a path reference, otherwise build the
33 CSS from the available values and parameters in self.style and
34 self.css()."""
35 b = view.context.b
36 if self.cssCode is not None:
37 b.addHtml(self.cssCode)
38 elif self.cssPath is not None:
39 b.importCss(self.cssPath) # Add CSS content of file, if path is not None and the file exists.
40 else:
41 b.headerCss(self.into.title or self.name or self.title)
42 b.resetCss() # Add CSS to reset specific default behavior of browsers.
43 b.sectionCss('Document root style')
44 b.css('body', e=view) # <body> selector and style output
45
46 # Alternative view behavior.
47 # Because HTML-pages don't really need or handle print-view options

Callers

nothing calls this directly

Calls 6

addHtmlMethod · 0.80
importCssMethod · 0.80
headerCssMethod · 0.80
resetCssMethod · 0.80
sectionCssMethod · 0.80
cssMethod · 0.45

Tested by

no test coverage detected