Version: 1.0 | 1.1 | 2.0 |

StyleDecorator

in namespace DotVVM.Framework.Controls.Bootstrap

Decorates wrapped element.

Properties

Name Type Description Notes Default Value
BackgroundColor BootstrapContextualBackgroundColor
attribute
inner element
static value
bindable
default
None
Centered Boolean
attribute
inner element
static value
bindable
default
False
ClearFix Boolean
attribute
inner element
static value
bindable
default
False
Float BootstrapQuickFloat
attribute
inner element
static value
bindable
default
None
ForceHidden Boolean
attribute
inner element
static value
bindable
default
False
ForceShown Boolean
attribute
inner element
static value
bindable
default
False
TextColor BootstrapContextualColor
attribute
inner element
static value
bindable
default
None
Visibility BootstrapVisibility
attribute
inner element
static value
bindable
default
None

Events

Name Type Description

Usage & Scenarios

Decorates inner elements with various properties and Bootstrap CSS classes.

HTML Rendered by the Control

Sample 1: StyleDecorator - Text Colors

The StyleDecorator control has the TextColor property for setting the text color of inner element using Bootstrap colors.

<bs:StyleDecorator TextColor="None">
  <p>Text with TextColor set to: None</p>
</bs:StyleDecorator>

<bs:StyleDecorator TextColor="Muted">
  <p>Text with TextColor set to: Muted</p>
</bs:StyleDecorator>

<bs:StyleDecorator TextColor="Primary">
  <p>Text with TextColor set to: Primary</p>
</bs:StyleDecorator>

<bs:StyleDecorator TextColor="Success">
  <p>Text with TextColor set to: Success</p>
</bs:StyleDecorator>

<bs:StyleDecorator TextColor="Info">
  <p>Text with TextColor set to: Info</p>
</bs:StyleDecorator>

<bs:StyleDecorator TextColor="Warning">
  <p>Text with TextColor set to: Warning</p>
</bs:StyleDecorator>

<bs:StyleDecorator TextColor="Danger">
  <p>Text with TextColor set to: Danger</p>
</bs:StyleDecorator>

Sample 2: StyleDecorator - Background colors

The StyleDecorator control has the BackgroundColor property for setting the background color of inner element using Bootstrap colors.

<bs:StyleDecorator BackgroundColor="None">
  <p>Text with BackgroundColor set to: None</p>
</bs:StyleDecorator>

<bs:StyleDecorator BackgroundColor="Primary">
  <p>Text with BackgroundColor set to: Primary</p>
</bs:StyleDecorator>

<bs:StyleDecorator BackgroundColor="Success">
  <p>Text with BackgroundColor set to: Success</p>
</bs:StyleDecorator>

<bs:StyleDecorator BackgroundColor="Info">
  <p>Text with BackgroundColor set to: Info</p>
</bs:StyleDecorator>

<bs:StyleDecorator BackgroundColor="Warning">
  <p>Text with BackgroundColor set to: Warning</p>
</bs:StyleDecorator>

<bs:StyleDecorator BackgroundColor="Danger">
  <p>Text with BackgroundColor set to: Danger</p>
</bs:StyleDecorator>

Sample 3: StyleDecorator - Visibility

The StyleDecorator control has the Visibility property for setting inner element visible or hidden option for specific screen sizes.

The values are:

  • None

  • VisibleExtraSmallBlock

  • VisibleExtraSmallInline

  • VisibleExtraSmallInlineBlock

  • VisibleSmallBlock

  • VisibleSmallInline

  • VisibleSmallInlineBlock

  • VisibleMediumBlock

  • VisibleMediumInline

  • VisibleMediumInlineBlock

  • VisibleLargeBlock

  • VisibleLargeInline

  • VisibleLargeInlineBlock

  • HiddenExtraSmall

  • HiddenSmall

  • HiddenMedium

  • HiddenLarge

<bs:StyleDecorator Visibility="VisibleExtraSmallBlock">
  <p>Text vissible on extra small devices.</p>
</bs:StyleDecorator>

<bs:StyleDecorator Visibility="VisibleMediumBlock">
  <p>Text vissible on devices with medium sized display.</p>
</bs:StyleDecorator>

<bs:StyleDecorator Visibility="HiddenSmall">
  <p>Text hidden on small devices.</p>
</bs:StyleDecorator>

<bs:StyleDecorator Visibility="HiddenLarge">
  <p>Text hidden on large devices.</p>
</bs:StyleDecorator>

Sample 4: StyleDecorator - Other properties

StyleDecorator control has Center property of bool for centering text in wrapping element and ClearFix property of bool for using clearfix.

It is also possible to force inner element to be shown with ForceShown property or hidden with ForceHidden property.

To float inner element to the left or right Float property is used.

<bs:StyleDecorator Centered="true">
  <p>Centered text</p>
</bs:StyleDecorator>

<bs:StyleDecorator ClearFix="true">
  <p>Text with ClearFix.</p>
</bs:StyleDecorator>

<bs:StyleDecorator ForceShown="true">
  <p>Force shown text.</p>
</bs:StyleDecorator>

<bs:StyleDecorator ForceHidden="true">
  <p>Force hidden text.</p>
</bs:StyleDecorator>

<bs:StyleDecorator Float="Left">
  <p>Text with float:left.</p>
</bs:StyleDecorator>

<bs:StyleDecorator Float="Right">
  <p>Text with float:right.</p>
</bs:StyleDecorator>

Sample 5: StyleDecorator - Active properties

All properties of StyleDecorator can be used on other elements. (You can set TextColor on <div> for example.)

<p StyleDecorator.BackgroundColor="Success" StyleDecorator.TextColor="Danger" StyleDecorator.Visibility="HiddenSmall" StyleDecorator.Float="Right" StyleDecorator.ClearFix="true" StyleDecorator.Centered="true" data-ui="activeProp-background-text-binding-all-true">
  Text text text text.
</p>

Suggestions


Help & Contribute

The documentation is maintained on GitHub.
We'll be happy if you edit the page and create a pull request.

Send message