Border Style

CSS styles can be applied to the border of a component matching certain criteria. Groups of mutually exclusive styles are defined by <styles> elements. There can be any number of <styles> elements, each one containing one or more <style> elements that provide the matching rule and CSS expression. The style is applied to the border generated for components or the rectangle used for collections, blocks and layers.

Style group

Syntax: <styles …> … </styles>

Example:: <styles> <style …/> … </styles>

Use: Groups a set of CSS style rules.

The <styles> element groups together a set of options for adding CSS styles to System Model items. The first contained <style> element with a matching rule or value is used to style the item.

For example:

<?xml version="1.0"?>
<shapes xmlns:svg="http://www.w3.org/2000/svg">

<style rule="@plugin='Y'" label="Plugin Compo&#xad;nent">stroke-width: 2</style>
    <style rule="@outsource" label="Outsourced">stroke-width: 4</style>
    <style>stroke-width: 0.4</style> <!-- default style used if no others match -->
</styles>
<styles>
    <style rule="Build and not(Build/*)" label="No build info">stroke-dasharray: 2,3;</style>
</styles> <!-- no default styles for this group -->

Each style group is completely independent of each other. This means that the CSS styles generated by a group are processed in order. In the preceding example, if the component is a plug-in and contains no build data, styles from both <styles> will be combined when drawing the component, for example, style="stroke-width: 2; stroke-dasharray: 2,3;".

Style groups and options follow the standard matching rules. For more information, see Display Options and Display Option Groups.