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.

116 lines
4.3 KiB

  1. ---
  2. layout : 'default'
  3. css : 'guide'
  4. title : 'Overview'
  5. description : 'An introduction to Semantic style coding'
  6. type : 'UI Introduction'
  7. ---
  8. <script src="/javascript/intro.js"></script>
  9. <script>
  10. $(document)
  11. .ready(function() {
  12. $('.demo.menu .item')
  13. .tab()
  14. ;
  15. })
  16. ;
  17. </script>
  18. <%- @partial('header') %>
  19. <div class="main container">
  20. <div class="peek">
  21. <div class="ui vertical pointing secondary menu">
  22. <a class="active item">Interfacing</a>
  23. <a class="item">APIs</a>
  24. </div>
  25. </div>
  26. <h2 class="ui dividing header">Interfacing Carefully</h2>
  27. <p>UI definitions in Semantic are given the class name <code>ui</code>. This is to help tell the difference between ui elements and parts of the definition of an element. This means any element with the class name UI has a corresponding UI definition.
  28. <p>For example a menu may have menu items inside of it. These items are contained as part of the menu definition but do not receive the class name <code>ui</code> because they are part of a UI menu collection.</p>
  29. <div class="code" data-type="html" data-title="A Simple Menu" data-preview="true">
  30. <div class="ui menu">
  31. <a class="item">Home</a>
  32. <a class="item">Inbox</a>
  33. </div>
  34. </div>
  35. <h3 class="ui header">Changing an Element</h3>
  36. <p>Class names in Semantic always use single english words. If a class name is an adjective it is either a <a href="/introduction/types.html">type</a> of element or <a href="/introduction/variations.html">variation</a> of an element. <b>CSS definitions always define adjectives in the context of a noun</b>. In this way class names cannot pollute the namespace.</p>
  37. <div class="code" data-type="html" data-title="A Compact Menu Variation" data-preview="true">
  38. <div class="ui compact menu">
  39. <a class="item">Home</a>
  40. <a class="item">Inbox</a>
  41. </div>
  42. </div>
  43. <div class="ui divider"></div>
  44. <h3 class="ui header">Combining elements</h3>
  45. <p>All UI definitions in semantic are stand-alone, and do not require other components to function. However, components can choose to have optional couplings with other components.</p>
  46. <p>For example you might want to include a badge inside a menu. A label inside of a menu will automatically function as a badge.</p>
  47. <div class="code" data-type="html" data-title="Using a UI Label inside a UI Menu" data-preview="true">
  48. <div class="ui compact menu">
  49. <a class="item">Home</a>
  50. <a class="item">
  51. Inbox
  52. <div class="ui label">22</div>
  53. </a>
  54. </div>
  55. </div>
  56. <h2 class="ui dividing header">Semantic APIs</h2>
  57. <p>Modules define a public API using verbs and simple phrases. When methods are invoked internally those phrases are matched to internal methods automatically.</p>
  58. <div class="code" data-type="html" data-label="true" data-preview="true">
  59. <div class="ui pointing secondary demo menu">
  60. <a class="active red item" data-tab="first">First</a>
  61. <a class="blue item" data-tab="second">Second</a>
  62. <a class="green item" data-tab="third">Third</a>
  63. </div>
  64. <div class="ui active tab segment" data-tab="first">First</div>
  65. <div class="ui tab segment" data-tab="second">Second</div>
  66. <div class="ui tab segment" data-tab="third">Third</div>
  67. </div>
  68. <h3 class="ui header">Opening a new tab with a behavior</h3>
  69. <p>Modules have simple behaviors for triggering common actions</p>
  70. <div class="code" data-demo="true">
  71. $('.demo.menu .item')
  72. .tab('change tab', 'second')
  73. ;
  74. </div>
  75. <h3 class="ui header">Opening a new tab with multiple behaviors</h3>
  76. <p>Any internal behavior is accessible as well</p>
  77. <div class="code" data-demo="true">
  78. $('.demo.menu .item')
  79. .tab('deactivate all')
  80. .tab('activate tab', 'third')
  81. .tab('activate navigation', 'third')
  82. ;
  83. </div>
  84. <h3 class="ui header">Turning on HTML5 State</h3>
  85. <p>Modules can be re-initialized at any time with different settings</p>
  86. <div class="code" data-demo="true">
  87. $('.demo.menu .item')
  88. .tab({
  89. history : true,
  90. path : '/introduction/getting-started.html'
  91. })
  92. ;
  93. </div>
  94. <div class="ui divider"></div>
  95. <a class="ui large right labeled teal icon button" href="/introduction/types.html">
  96. Next: UI Types
  97. <i class="right arrow icon"></i>
  98. </a>
  99. </div>