(self)
return css
CSS styles for the placeholders and plugins.

        The placeholder dimensions as well as columns sizes, should be
        handled here. Since we are in a placeholder and a placeholder has a
        defined number of rows and columns and each render has just a fixed
        amount of rows and columns defined, we can render the top left
        corners generic css classes.

        Cells do NOT have margins or paddings. This is essential (since all
        the plugins are positioned absolutely). If you want to have padding in
        your plugin widget, specify the `plugin-content-wrapper` class style
        in your specific layout/theme.

        :example:

            .placeholder .plugin .plugin-content-wrapper {
                padding: 5px;
            }

        :return string:
CSS styles for the placeholders and plugins.
CSS styles for the placeholders and plugins .
def css(self):
        """CSS styles for the placeholders and plugins.

        The placeholder dimensions as well as columns sizes, should be
        handled here. Since we are in a placeholder and a placeholder has a
        defined number of rows and columns and each render has just a fixed
        amount of rows and columns defined, we can render the top left
        corners generic css classes.

        Cells do NOT have margins or paddings. This is essential (since all
        the plugins are positioned absolutely). If you want to have padding in
        your plugin widget, specify the `plugin-content-wrapper` class style
        in your specific layout/theme.

        :example:

            .placeholder .plugin .plugin-content-wrapper {
                padding: 5px;
            }

        :return string:
        """
        def placeholder_width():
            """Placeholder width.

            :return string:
            """
            return '{0}{1}'.format(self.cols * self.get_cell_width(),
                                   self.cell_units)

        def placeholder_height():
            """Placeholder height.

            :return string:
            """
            return '{0}{1}'.format(self.rows * self.get_cell_height(),
                                   self.cell_units)

        def plugin_width():
            """Default width of a plugin widget (1 cell).

            :return string:
            """
            return '{0}{1}'.format(self.cell_width, self.cell_units)

        def plugin_height():
            """Default height of a plugin widget (1 cell).

            :return string:
            """
            return '{0}{1}'.format(self.cell_height, self.cell_units)

        def plugin_positions():
            """Plugin positions depending on the row and cell occupied.

            All plugins are positioned absolutely. Based on the row, we use
            `margin-top` and `margin-left` to position a plugin.

            ..:Used CSS classes:
                - `row-1`, `row-2`, etc.
                - `col-1`, `col-2`, etc.

            :return string:
            """
            positions = []
            row_template = """
            .placeholder.{placeholder_class} .empty-widget-cell.row-{row_num},
            .placeholder.{placeholder_class} .plugin.row-{row_num} {{
                margin-top: {top};
            }}
            """
            for row_num in range(0, self.rows):
                _val = row_template.format(
                    placeholder_class=self.primary_html_class,
                    row_num=(row_num + 1),
                    top='{0}{1}'.format(self.get_cell_height() * row_num,
                                        self.cell_units)
                )
                positions.append(_val)

            col_template = """
            .placeholder.{placeholder_class} .empty-widget-cell.col-{col_num},
            .placeholder.{placeholder_class} .plugin.col-{col_num} {{
                margin-left: {left};
            }}
            """
            for col_num in range(0, self.cols):
                _val = col_template.format(
                    placeholder_class=self.primary_html_class,
                    col_num=(col_num + 1),
                    left='{0}{1}'.format(self.get_cell_width() * col_num,
                                         self.cell_units)
                )
                positions.append(_val)

            return '\n'.join(positions)

        def plugin_sizes():
            """Plugin size based on its' `rows` and `cols` properties.

            ..:Used CSS classes:
                - `width-1`, `width-2`, etc.
                - `height-1`, `height-2`, etc.

            :return string:
            """
            sizes = []

            row_template = """
            .placeholder.{placeholder_class} .plugin.height-{row_num} {{
                height: {height};
            }}
            """
            for row_num in range(0, self.rows):
                _val = row_template.format(
                    placeholder_class=self.primary_html_class,
                    row_num=(row_num + 1),
                    height='{0}{1}'.format(
                        self.widget_inner_height(row_num + 1),
                        self.cell_units
                    )
                )
                sizes.append(_val)

            col_template = """
            .placeholder.{placeholder_class} .plugin.width-{col_num} {{
                width: {width};
            }}
            """
            for col_num in range(0, self.cols):
                _val = col_template.format(
                    placeholder_class=self.primary_html_class,
                    col_num=(col_num + 1),
                    width='{0}{1}'.format(
                        self.widget_inner_width(col_num + 1),
                        self.cell_units
                    )
                )
                sizes.append(_val)

            return '\n'.join(sizes)

        def empty_cell_size():
            """CSS for empty cell size."""
            _val = """
            .placeholder.{placeholder_class} .empty-widget-cell {{
                width: {width};
                height: {height};
                line-height: {height};
            }}
            """.format(
                placeholder_class=self.primary_html_class,
                width='{0}{1}'.format(self.cell_width, self.cell_units),
                height='{0}{1}'.format(self.cell_height, self.cell_units)
            )
            return _val

        css = """
        .placeholder.{placeholder_class} {{
            width: {placeholder_width};
            height: {placeholder_height};
        }}

        .placeholder.{placeholder_class} .plugin {{
            width: {plugin_width};
            height: {plugin_height};
        }}

        {plugin_positions}

        {plugin_sizes}

        {empty_cell_sizes}
        """.format(
            placeholder_class=self.primary_html_class,
            placeholder_width=placeholder_width(),
            placeholder_height=placeholder_height(),
            plugin_width=plugin_width(),
            plugin_height=plugin_height(),
            plugin_positions=plugin_positions(),
            plugin_sizes=plugin_sizes(),
            empty_cell_sizes=empty_cell_size()
        )

        return css
def css ( self ) : def placeholder_width ( ) : """Placeholder width.

            :return string:
            """ return '{0}{1}' . format ( self . cols * self . get_cell_width ( ) , self . cell_units ) def placeholder_height ( ) : """Placeholder height.

            :return string:
            """ return '{0}{1}' . format ( self . rows * self . get_cell_height ( ) , self . cell_units ) def plugin_width ( ) : """Default width of a plugin widget (1 cell).

            :return string:
            """ return '{0}{1}' . format ( self . cell_width , self . cell_units ) def plugin_height ( ) : """Default height of a plugin widget (1 cell).

            :return string:
            """ return '{0}{1}' . format ( self . cell_height , self . cell_units ) def plugin_positions ( ) : """Plugin positions depending on the row and cell occupied.

            All plugins are positioned absolutely. Based on the row, we use
            `margin-top` and `margin-left` to position a plugin.

            ..:Used CSS classes:
                - `row-1`, `row-2`, etc.
                - `col-1`, `col-2`, etc.

            :return string:
            """ positions = [ ] row_template = """
            .placeholder.{placeholder_class} .empty-widget-cell.row-{row_num},
            .placeholder.{placeholder_class} .plugin.row-{row_num} {{
                margin-top: {top};
            }}
            """ for row_num in range ( 0 , self . rows ) : _val = row_template . format ( placeholder_class = self . primary_html_class , row_num = ( row_num + 1 ) , top = '{0}{1}' . format ( self . get_cell_height ( ) * row_num , self . cell_units ) ) positions . append ( _val ) col_template = """
            .placeholder.{placeholder_class} .empty-widget-cell.col-{col_num},
            .placeholder.{placeholder_class} .plugin.col-{col_num} {{
                margin-left: {left};
            }}
            """ for col_num in range ( 0 , self . cols ) : _val = col_template . format ( placeholder_class = self . primary_html_class , col_num = ( col_num + 1 ) , left = '{0}{1}' . format ( self . get_cell_width ( ) * col_num , self . cell_units ) ) positions . append ( _val ) return '\n' . join ( positions ) def plugin_sizes ( ) : """Plugin size based on its' `rows` and `cols` properties.

            ..:Used CSS classes:
                - `width-1`, `width-2`, etc.
                - `height-1`, `height-2`, etc.

            :return string:
            """ sizes = [ ] row_template = """
            .placeholder.{placeholder_class} .plugin.height-{row_num} {{
                height: {height};
            }}
            """ for row_num in range ( 0 , self . rows ) : _val = row_template . format ( placeholder_class = self . primary_html_class , row_num = ( row_num + 1 ) , height = '{0}{1}' . format ( self . widget_inner_height ( row_num + 1 ) , self . cell_units ) ) sizes . append ( _val ) col_template = """
            .placeholder.{placeholder_class} .plugin.width-{col_num} {{
                width: {width};
            }}
            """ for col_num in range ( 0 , self . cols ) : _val = col_template . format ( placeholder_class = self . primary_html_class , col_num = ( col_num + 1 ) , width = '{0}{1}' . format ( self . widget_inner_width ( col_num + 1 ) , self . cell_units ) ) sizes . append ( _val ) return '\n' . join ( sizes ) def empty_cell_size ( ) : """CSS for empty cell size.""" _val = """
            .placeholder.{placeholder_class} .empty-widget-cell {{
                width: {width};
                height: {height};
                line-height: {height};
            }}
            """ . format ( placeholder_class = self . primary_html_class , width = '{0}{1}' . format ( self . cell_width , self . cell_units ) , height = '{0}{1}' . format ( self . cell_height , self . cell_units ) ) return _val css = """
        .placeholder.{placeholder_class} {{
            width: {placeholder_width};
            height: {placeholder_height};
        }}

        .placeholder.{placeholder_class} .plugin {{
            width: {plugin_width};
            height: {plugin_height};
        }}

        {plugin_positions}

        {plugin_sizes}

        {empty_cell_sizes}
        """ . format ( placeholder_class = self . primary_html_class , placeholder_width = placeholder_width ( ) , placeholder_height = placeholder_height ( ) , plugin_width = plugin_width ( ) , plugin_height = plugin_height ( ) , plugin_positions = plugin_positions ( ) , plugin_sizes = plugin_sizes ( ) , empty_cell_sizes = empty_cell_size ( ) ) return css