""" open/dulcinea/lib/ui/css.qpy Example Directory that exports example CSS useful in formatting of many of the UI components contained in Dulcinea. """ from dulcinea.ui.crumbs import format_crumbs_css from dulcinea.ui.form.search_widget import format_search_select_css from dulcinea.ui.table import format_table_css from dulcinea.ui.user.util import format_act_as_css, format_signin_css from qp.fill.css import BASIC_FORM_CSS from qp.fill.directory import Directory from qp.pub.common import get_response default_color_map = dict( CRUMBS_BG='#888', CRUMBS_FG='#444', SELECTED_BG='#888', SELECTED_FG='#444', LIGHT_A_VISITED='white', BODY_BG='white', BODY_FG='black', LIGHT_A='white', LIGHT_A_HOVER='white', DATA = '#cec', HEADING = '#aca', DATA_BORDER = '', ) def format_base_css:str(color_map=default_color_map): format_act_as_css() BASIC_FORM_CSS format_signin_css() format_search_select_css() format_crumbs_css(color_map) format_table_css() """\ body { background: %(BODY_BG)s; color: %(BODY_FG)s; margin: 0; font-family: sans-serif; } dl.index { border: 1em solid %(HEADING)s; margin: 0; } dl.index dt { padding-left: 1ex; font-weight: bold; background: %(DATA)s; } dl.index dt span.counter { padding-right: 1em; font-weight: normal; font-size: smaller; text-align: right; width: 3em; float:left; color: #050; } dl.index dd { padding-left: 2em; } div.header { border-bottom: thin solid #040; background: %(HEADING)s; } div.header div.title { padding: 10px 0 10px 1em; font-size: x-large; font-weight: bold; color: #050; padding-bottom: 1ex; } div.header a { text-decoration: none; } div.header a:hover { text-decoration: underline; } div.footer { clear: both; padding: 1em; } div.boxtitle { font-weight: bold; font-family: sans-serif; margin-top: 1em; } table.shaded { border: thin solid black; padding: 2px; background-color: #fff } table.shaded th { background: %(HEADING)s; } table.shaded tr td { background: %(DATA)s; } table.shaded th, table.shaded td { text-align: left; vertical-align: top } div.searchresultspage { margin: 0; padding: 0.2ex; background: %(HEADING)s; font-size: small; } div.searchresultspage a { margin: 0; padding: 0.2ex; } span.selectedsearchresultspage { margin: 0; padding: 0.2ex; background: %(DATA)s; } form div { background: %(HEADING)s; border: thin solid #040; margin: 5px; } form div div { border: none; margin: 0; } form.qp div.submit { float: left; } table.boxbody { padding: 2px; } table.boxbody th { padding: 2px; text-align: left; background: %(HEADING)s; } table.boxbody td { padding: 2px; text-align: left; background: %(DATA)s; } """ % color_map class StyleDirectory(Directory): def get_exports(self): yield ('base.css', 'base_css', None, None) def base_css:str(self): response = get_response() response.set_expires(days=1) response.set_content_type('text/css', 'utf8') format_base_css()