You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

132 lines
4.4 KiB

  1. ---
  2. layout : 'default'
  3. css : 'guide'
  4. title : 'Variations'
  5. description : 'Variations are stackable, symbiotic changes to an elements appearance'
  6. type : 'UI Introduction'
  7. ---
  8. <script src="/javascript/intro.js"></script>
  9. <%- @partial('header') %>
  10. <div class="main container">
  11. <div class="peek">
  12. <div class="ui vertical pointing secondary menu">
  13. <a class="active item">Overview</a>
  14. <a class="item">Usage</a>
  15. </div>
  16. </div>
  17. <h2 class="ui dividing header">Overview</h2>
  18. <p>A <b>variation</b> alters the design of an element but is not mutually exclusive. Variations can be stacked together, or be used along with altering an element's type.</p>
  19. <p>For example, having wide menus that take up the full width of its parent may sometimes be overwhelming. You can use the compact variation of a menu to alter its format to only take up the necessary space.</p>
  20. <div class="code" data-type="html" data-label="true">
  21. <div class="ui compact tiered menu">
  22. ...
  23. </div>
  24. </div>
  25. <div class="ui compact tiered menu">
  26. <div class="menu">
  27. <div class="active item">
  28. <i class="home icon"></i>
  29. Home
  30. </div>
  31. <a class="item">
  32. <i class="mail icon"></i>
  33. Mail
  34. <div class="ui label">22</div>
  35. </a>
  36. </div>
  37. <div class="sub menu">
  38. <a class="active item">Activity</a>
  39. <a class="item">Profile</a>
  40. </div>
  41. </div>
  42. <h3 class="ui header">Context sensitive</h3>
  43. <p>In Semantic, variations maintain context based on the element they modify, but keep the same vocabulary between elements. Just like how in English, the adjective 'big' may describe a different scale for a big planet versus a big insect.</p>
  44. <p>For example an icon might need to modify it's vertical alignment when it is larger than the surrounding text, while a form does not.</p>
  45. <p>All definitions in Semantic <b>are based around em and rem</b> so resizing an element usually is as simple as altering the base font size of the element, padding, margins, and other properties will adjust automatically.</p>
  46. <div class="code" data-type="css" data-label="true">
  47. /* a large form is not quite as large as a large icon */
  48. .ui.large.form {
  49. font-size: 1.125em;
  50. }
  51. /* icons need to adjust vertical alignment as they grow past 1em */
  52. i.large.icon {
  53. font-size: 1.5em;
  54. vertical-align: middle;
  55. }
  56. </div>
  57. <h2 class="ui dividing header">Using Variations Together</h2>
  58. <p>Another variation of a menu is an <b>inverted menu</b>. This alters the color contrast to appear inverted for darker backgrounds. Some variations may also mutate when used together. Lets try adding the class name <code>red</code> as well.</p>
  59. <p>Variations are not mutually exclusive and can be used together harmoniously, so we can use these together to create an <code>inverted red tiered menu</code></p>
  60. <div class="code" data-type="html" data-label="true">
  61. <div class="ui red inverted tiered menu">
  62. ...
  63. </div>
  64. </div>
  65. <div class="ui red inverted tiered menu">
  66. <div class="menu">
  67. <div class="active item">
  68. <i class="home icon"></i>
  69. Home
  70. </div>
  71. <a class="item">
  72. <i class="mail icon"></i>
  73. Mail
  74. <div class="ui label">22</div>
  75. </a>
  76. </div>
  77. <div class="sub menu">
  78. <a class="active item">Activity</a>
  79. <a class="item">Profile</a>
  80. </div>
  81. </div>
  82. <div class="ui divider"></div>
  83. <h3 class="ui header">Intersecting Variations</h3>
  84. <p>The definition for the variation red contains css specifically for describing the intersection of both <code>red</code> and <code>inverted</code>. For example, lets see the same menu with only the red variation.</p>
  85. <div class="code" data-type="html" data-label="true">
  86. <div class="ui red tiered menu">
  87. ...
  88. </div>
  89. </div>
  90. <div class="ui red tiered menu">
  91. <div class="menu">
  92. <div class="active item">
  93. <i class="home icon"></i>
  94. Home
  95. </div>
  96. <a class="item">
  97. <i class="mail icon"></i>
  98. Mail
  99. <div class="ui label">22</div>
  100. </a>
  101. </div>
  102. <div class="sub menu">
  103. <a class="active item">Activity</a>
  104. <a class="item">Profile</a>
  105. </div>
  106. </div>
  107. <div class="ui divider"></div>
  108. <a class="ui large right labeled teal icon button" href="/element.html">
  109. Next: View Elements
  110. <i class="right arrow icon"></i>
  111. </a>
  112. <!--
  113. </div>