Turnkey Styling
(Adding page to Category:TOC because it contains a TOC.)
 
(101 intermediate revisions by 5 users not shown)
Line 1: Line 1:
[[Category:MDriven Turnkey]]
[[Category:MDriven Turnkey]]


== Getting started ==
=== Getting Started ===
MDriven Turnkey Style system based on the BEM methodology. BEM stands for Block, Element, Modifier and it is a convention on how to structure CSS rules. [https://de.wikipedia.org/wiki/Block,_Element,_Modifier Read more here].
The MDriven Turnkey Style system is based on the BEM methodology. BEM stands for Block, Element, Modifier and is a convention on how to structure CSS rules. [https://de.wikipedia.org/wiki/Block,_Element,_Modifier Read more here].


Out of the box you will receive the following UI elements:
Out of the box, you will receive the following UI elements:
* Static text
* Static text
* Image
* Image
Line 20: Line 20:


== Layout ==
== Layout ==
MDriven Turnkey uses CSS Grid to create the application layout.
MDriven Turnkey uses the CSS Grid to create the application layout - unless you make use of [[PlacingContainer|placingcontainers]] - then the CSS flexbox is the core layout creator.


== Components ==
== What are Modifier-classes? ==
Modifier-classes allow you to customise MDriven Turnkey's components.


=== Buttons ===
To use modifier-classes, put them into the "'''Style ref'''" field in the ViewModel Editor.
Out of the box in MDriven Turnkey you have the '''''default''''' button styles, but you can modify it with the predefined '''Modifier-classes'''. To style your buttons add the modifier classes to ''style-reference'' in your viewmodel column. Find out all predefined modifier classes for the buttons, below.<html>
[[File:StyleRef field in ViewModel editor.png|none|thumb|708x708px|'''Style ref''' in ViewModel editor]]
<head>
<script src="/extensions/style-system-presentation/ripple.js"></script>
<link rel="stylesheet" href="/extensions/style-system-presentation/style.css">
</head>


<body>
== Text Elements ==


  <p><b>Default</b> buttons in MDriven Turnkey</p>
=== Context Colors ===
From the box, you're able to use five default contextual colours in MDriven Turnkey. You can modify them with the help of CSS custom properties.
* Danger
* Warning
* Success
* Info


  <p><b>Generic modifier classes</b> for the buttons:<p>
=== Chip ===
  <ul>
With the help of the modifier-classes, you can style your static text as a chip component from Google Material design.
        <li><b>danger</b></li>
{| class="wikitable"
        <li><b>warning</b></li>
!Example
        <li><b>success</b></li>
!Modifier-class
        <li><b>info</b></li>
|-
        <li><b>primary </b> (applies primary color of your application)</li>
|[[File:Chip default.png|frameless]]
  </ul>
|'''chip'''
|-
|[[File:Chip danger.png|frameless]]
|'''chip danger'''
|-
|[[File:Chip warning.png|frameless]]
|'''chip warning'''
|-
|[[File:Chip success.png|frameless]]
|'''chip success'''
|-
|[[File:Chip info.png|frameless]]
|'''chip info'''
|}


  <div class="examples">
=== Info Block ===
    <div class="examples__item" title="">
Coming soon...
      <button class="tk-button__native ripple-effect">Button</button>
    </div>


    <div class="examples__item" title="danger">
== Checkbox and Switch ==
      <button class="tk-button__native ripple-effect danger">Button</button>
'''Checkbox''' is the default presentation of the boolean attribute in your model.
    </div>
{| class="wikitable"
!Example
!Description
|-
|[[File:Checkbox default.png|frameless]]
|Default checkbox presentation
|-
|[[File:Checkbox checked.png|frameless]]
|Checkbox checked presentation
|}
'''Switch''' is a different way in which you can present your boolean attribute in MDriven Turnkey. To change the presentation of the boolean attribute from the default '''checkbox''' to '''switch,''' set the '''TaggedValue "Switch"''' to your ViewModelColumn.
{| class="wikitable"
!Example
!Description
|-
|[[File:Switch default.png|frameless]]
|Default switch presentation
|-
|[[File:Switch selected.png|frameless]]
|Switch selected presentation
|}


    <div class="examples__item" title="warning">
== Typography ==
      <button class="tk-button__native ripple-effect warning">Button</button>
With the help of the modifier-classes, you can style the text data in your Turnkey application as headings. The available modifier-classes are listed in the table below.
    </div>
{| class="wikitable"
!Example
!Modifier-class
|-
|[[File:Turnkey heading h1.png|frameless]]
|'''h1'''
|-
|[[File:Turnkey heading h2.png|frameless]]
|'''h2'''
|-
|[[File:Turnkey heading h3.png|frameless]]
|'''h3'''
|-
|[[File:Turnkey heading h4.png|frameless]]
|'''h4'''
|-
|[[File:Turnkey heading h5.png|frameless]]
|'''h5'''
|-
|[[File:Turnkey heading h6.png|frameless]]
|'''h6'''
|}
See also: [[Layout and CSS]]


    <div class="examples__item" title="success">
== Date Picker ==
      <button class="tk-button__native ripple-effect success">Button</button>
{{Edited|July|12|2024}}
    </div>


    <div class="examples__item" title="info">
[[Category:TOC]]
      <button class="tk-button__native ripple-effect info">Button</button>
    </div>
 
    <div class="examples__item" title="primary">
      <button class="tk-button__native ripple-effect primary">Button</button>
    </div>
 
    <div class="examples__item" title="Disabled state">
      <button class="tk-button__native ripple-effect" disabled="disabled">Button</button>
    </div>
  </div>
 
  <p><b>Oulined</b> buttons in MDriven Turnkey. </p>
  <p>Add to style-references "<b>outlined</b>". Also, you can use generic modifier classes in pair with the "outlined". E.g.: "outlined danger", "outlined warning", "outlined primary"</p>
 
  <div class="examples">
    <div class="examples__item" title="outkined">
      <button class="tk-button__native  ripple-effect outlined">Outlined</button>
    </div>
 
    <div class="examples__item" title="outlined danger">
      <button class="tk-button__native ripple-effect outlined danger">Outlined</button>
    </div>
 
    <div class="examples__item" title="outlined warning">
      <button class="tk-button__native ripple-effect outlined warning">Outlined</button>
    </div>
 
    <div class="examples__item" title="outlined success">
      <button class="tk-button__native ripple-effect success outlined">Outlined</button>
    </div>
 
    <div class="examples__item" title="outlined info">
      <button class="tk-button__native ripple-effect info outlined">Outlined</button>
    </div>
 
    <div class="examples__item" title="outlined primary">
      <button class="tk-button__native ripple-effect primary outlined">Outlined</button>
    </div>
 
    <div class="examples__item" title="Disabled state">
      <button class="tk-button__native ripple-effect outlined" disabled="disabled">Outlined</button>
    </div>
  </div>
 
  <p><b>Flat</b> buttons in MDriven Turnkey</p>
 
  <div class="examples">
    <div class="examples__item" title="flat">
      <button class="tk-button__native  ripple-effect flat">Flat</button>
    </div>
 
    <div class="examples__item" title="flat danger">
      <button class="tk-button__native ripple-effect flat danger">Flat</button>
    </div>
 
    <div class="examples__item" title="flat warning">
      <button class="tk-button__native ripple-effect flat warning">Flat</button>
    </div>
 
    <div class="examples__item" title="flat success">
      <button class="tk-button__native ripple-effect flat success">Flat</button>
    </div>
 
    <div class="examples__item" title="flat info">
      <button class="tk-button__native ripple-effect flat info">Flat</button>
    </div>
 
    <div class="examples__item" title="flat primary">
      <button class="tk-button__native ripple-effect flat primary">Flat</button>
    </div>
 
    <div class="examples__item" title="Disabled state">
      <button class="tk-button__native ripple-effect flat" disabled="disabled">Flat</button>
    </div>
  </div>
 
  <p><b>Shaped</b> buttons in MDriven Turnkey</p>
 
  <div class="examples">
    <div class="examples__item" title="shaped">
      <button class="tk-button__native ripple-effect shaped">Shaped</button>
    </div>
 
    <div class="examples__item" title="shaped danger">
      <button class="tk-button__native ripple-effect shaped danger">Shaped</button>
    </div>
 
    <div class="examples__item" title="shaped warning">
      <button class="tk-button__native ripple-effect shaped warning">Shaped</button>
    </div>
 
    <div class="examples__item" title="shaped success">
      <button class="tk-button__native ripple-effect shaped success">Shaped</button>
    </div>
 
    <div class="examples__item" title="shaped info">
      <button class="tk-button__native ripple-effect shaped info">Shaped</button>
    </div>
 
    <div class="examples__item" title="shaped primary">
      <button class="tk-button__native ripple-effect shaped primary">Shaped</button>
    </div>
 
    <div class="examples__item" title="Disabled state">
      <button class="tk-button__native ripple-effect shaped" disabled="disabled">Shaped</button>
    </div>
  </div>
</body>
</html>

Latest revision as of 14:14, 26 March 2024


Getting Started

The MDriven Turnkey Style system is based on the BEM methodology. BEM stands for Block, Element, Modifier and is a convention on how to structure CSS rules. Read more here.

Out of the box, you will receive the following UI elements:

  • Static text
  • Image
  • Text field
  • Checkbox
  • Select (Combobox)
  • Date picker
  • Data-table
  • Button
  • File upload
  • Link
  • Textarea
  • Number field
  • Float field

Layout

MDriven Turnkey uses the CSS Grid to create the application layout - unless you make use of placingcontainers - then the CSS flexbox is the core layout creator.

What are Modifier-classes?

Modifier-classes allow you to customise MDriven Turnkey's components.

To use modifier-classes, put them into the "Style ref" field in the ViewModel Editor.

Style ref in ViewModel editor

Text Elements

Context Colors

From the box, you're able to use five default contextual colours in MDriven Turnkey. You can modify them with the help of CSS custom properties.

  • Danger
  • Warning
  • Success
  • Info

Chip

With the help of the modifier-classes, you can style your static text as a chip component from Google Material design.

Example Modifier-class
Chip default.png chip
Chip danger.png chip danger
Chip warning.png chip warning
Chip success.png chip success
Chip info.png chip info

Info Block

Coming soon...

Checkbox and Switch

Checkbox is the default presentation of the boolean attribute in your model.

Example Description
Checkbox default.png Default checkbox presentation
Checkbox checked.png Checkbox checked presentation

Switch is a different way in which you can present your boolean attribute in MDriven Turnkey. To change the presentation of the boolean attribute from the default checkbox to switch, set the TaggedValue "Switch" to your ViewModelColumn.

Example Description
Switch default.png Default switch presentation
Switch selected.png Switch selected presentation

Typography

With the help of the modifier-classes, you can style the text data in your Turnkey application as headings. The available modifier-classes are listed in the table below.

Example Modifier-class
Turnkey heading h1.png h1
Turnkey heading h2.png h2
Turnkey heading h3.png h3
Turnkey heading h4.png h4
Turnkey heading h5.png h5
Turnkey heading h6.png h6

See also: Layout and CSS

Date Picker

This page was edited more than 9 months ago on 03/26/2024. What links here