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.

165 lines
5.3 KiB

11 years ago
  1. # Semantic
  2. Semantic is a set of specifications for sharing UI elements between developers. Semantic is also a UI library to make front end development simpler and easier to learn.
  3. ## About
  4. Semantic's goal is to define a vocabulary for interface elements based on consensus, and convention.
  5. For developers, this means defining class names for UI elements, outlining states that an elements can exist, and describing common variations of that element.
  6. ### Getting Started
  7. The Semantic library describes many UI elements which might not exist on every website. In most instances it might be best to build a custom build with only the components you need.
  8. You can use our build tool to select only the components you want
  9. http://semantic-ui.com/download
  10. Or download the entire library and build out the code yourself using Grunt or another package management system.
  11. git clone git@github.com:quirkyinc/semantic.git
  12. If you prefer to download the whole kit and kaboodle you can grab that as well.
  13. http://semantic-ui.com/ui/semantic.min.css
  14. http://semantic-ui.com/ui/semantic.min.js
  15. ## A More Semantic Web
  16. ### Based on class
  17. Semantic is based on class names, instead of tags. This means, except for links, tables and form elements, you can use semantic with tags like ``<div> <article> <nav>`` without any difference.
  18. ### Context sensitive
  19. 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.
  20. For example, a form you can have a variation called "inverted". This changes the appearance of form elements to work on dark backgrounds.
  21. ```html
  22. <div class="ui inverted form">
  23. <div class="field">
  24. <label>Name</label>
  25. <input type="text">
  26. </div>
  27. </div>
  28. ```
  29. The same variation can also be useful in the context of a menu.
  30. ```html
  31. <div class="ui inverted menu">
  32. <div class="item">Section 1</div>
  33. <div class="dropdown item">
  34. Dropdown
  35. <div class="menu">
  36. <div class="item">Dropdown item 1</div>
  37. <div class="item">Dropdown item 2</div>
  38. </div>
  39. </div>
  40. </div>
  41. ```
  42. ### Defining UI
  43. Here is part of Semantic's definition of a button
  44. **Standard**: A button is a shape that can be pressed in to complete an action.
  45. ```html
  46. <div class="ui button"></div>
  47. ```
  48. **State**: A button can sometimes be active, designating it is selected by the user.
  49. ```html
  50. <div class="ui active button">
  51. ```
  52. **Variations**: A button may sometimes look different than its prototype.
  53. ```html
  54. <div class="ui large blue icon button">
  55. <i class="ui icon heart"></i>
  56. </div>
  57. ```
  58. **Plurality**: A button can sometimes exist in a group of buttons
  59. ``` html
  60. <div class="ui large blue buttons">
  61. <div class="ui button">
  62. I am blue
  63. </div>
  64. <div class="ui button">
  65. I am blue too
  66. </div>
  67. </div>
  68. ```
  69. ## Types of UI
  70. UI components are split into four categories, ranging from smallest to largest:
  71. * UI Elements
  72. * UI Collections
  73. * UI Modules
  74. * UI Views
  75. All UI definitions are made of a neutral, ideal definition, a list of states it can occupy, and a set of common variations or "types" of that element.
  76. ### UI Elements
  77. UI Elements are interface elements which do not contain other elements inside themselves. This can be thought of as similar in definition as an "element" in chemistry.
  78. UI elements can have plural definitions when they are known to exist together frequently.
  79. In this case each button will be large because we understand it is a part of the large button group
  80. ``` html
  81. <div class="large buttons">
  82. <div class="ui button">Cancel</div>
  83. <div class="ui positive button">Continue</div>
  84. </div>
  85. ```
  86. Examples of UI elements:
  87. * Buttons
  88. * Labels
  89. * Headers
  90. * Progress bars
  91. ### UI Collections
  92. UI Collections are groups of heteregeneous UI elements which are usually found together. Carrying the chemistry metaphor, these can be thought of as molecules.
  93. UI collections have a definition of elements that exist, or could exist inside of them. They do not usually require all elements to be found, but they describe a list of the "usual suspects". Unlike elements, collections are not typically useful to define in plural.
  94. Examples of UI collections:
  95. * Forms
  96. * Tables
  97. * Grids (Layout)
  98. * Menus
  99. ## UI Modules
  100. UI modules are elements where it's behavior is a fundamental part of its definition. UI Modules are dependent on the javascript which carry their definition. They also may be more complex, and have a variety of different functions. Further abusing the scientific analogy: These can be thought of as "organs".
  101. Examples of UI modules:
  102. * Popups
  103. * Modals
  104. * Chatrooms
  105. * Calendar Pickers
  106. ## UI Views
  107. UI Views are common ways to structure types of content so that it can be understood more easily. A view's definition in semantic only describes the content which typically occupies the view.
  108. For example an activity feed in
  109. This is a UI
  110. Examples of UI views:
  111. ** Comment Feed
  112. ** Activity Feed
  113. ** Product List
  114. ## Usage
  115. ### Specification
  116. #### I want to contribute to the spec
  117. Semantic is very new standard, and we need a community to become truly useful. We're working currently to determine the best ways to engage the community for contribution. If you'd like to participate feel free to reach out by e-mail [semantic@quirky.com](mailto:semantic@quirky.com)