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.

166 lines
5.4 KiB

11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
11 years ago
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 listing common ways different types of an element can be described.
  6. ### Getting Started
  7. The Semantic library describes many UI elements. In most instances it might be best to build a custom build with only the elements 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. ## The Specification
  16. The aim of the semantic specification is to create conventions for structuring and naming code for describing interface elements.
  17. ### Based on class
  18. 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.
  19. ### Context sensitive
  20. 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.
  21. For example, a form you can have a variation called "inverted". This changes the appearance of form elements to work on dark backgrounds.
  22. ```html
  23. <div class="ui inverted form">
  24. <div class="field">
  25. <label>Name</label>
  26. <input type="text">
  27. </div>
  28. </div>
  29. ```
  30. The same variation can also be useful in the context of a menu.
  31. ```html
  32. <div class="ui inverted menu">
  33. <div class="item">Section 1</div>
  34. <div class="dropdown item">
  35. Dropdown
  36. <div class="menu">
  37. <div class="item">Dropdown item 1</div>
  38. <div class="item">Dropdown item 2</div>
  39. </div>
  40. </div>
  41. </div>
  42. ```
  43. ### Defining UI
  44. Here is part of Semantic's definition of a button
  45. **Standard**: A button is a shape that can be pressed in to complete an action.
  46. ```html
  47. <div class="ui button"></div>
  48. ```
  49. **State**: A button can sometimes be active, designating it is selected by the user.
  50. ```html
  51. <div class="ui active button">
  52. ```
  53. **Variations**: A button may sometimes look different than its prototype.
  54. ```html
  55. <div class="ui large blue icon button">
  56. <i class="ui icon heart"></i>
  57. </div>
  58. ```
  59. **Plurality**: A button can sometimes exist in a group of buttons
  60. ``` html
  61. <div class="ui large blue buttons">
  62. <div class="ui button">
  63. I am blue
  64. </div>
  65. <div class="ui button">
  66. I am blue too
  67. </div>
  68. </div>
  69. ```
  70. ## Types of UI
  71. UI components are split into four categories, ranging from smallest to largest:
  72. * UI Elements
  73. * UI Collections
  74. * UI Modules
  75. * UI Views
  76. 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.
  77. ### UI Elements
  78. 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.
  79. UI elements can have plural definitions when they are known to exist together frequently.
  80. In this case each button will be large because we understand it is a part of the large button group
  81. ``` html
  82. <div class="large buttons">
  83. <div class="ui button">Cancel</div>
  84. <div class="ui positive button">Continue</div>
  85. </div>
  86. ```
  87. Examples of UI elements:
  88. * Buttons
  89. * Labels
  90. * Headers
  91. * Progress bars
  92. ### UI Collections
  93. UI Collections are groups of heteregeneous UI elements which are usually found together. Carrying the chemistry metaphor, these can be thought of as molecules.
  94. 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.
  95. Examples of UI collections:
  96. * Forms
  97. * Tables
  98. * Grids (Layout)
  99. * Menus
  100. ## UI Modules
  101. 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".
  102. Examples of UI modules:
  103. * Popups
  104. * Modals
  105. * Chatrooms
  106. * Calendar Pickers
  107. ## UI Views
  108. 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.
  109. For example an activity feed in
  110. This is a UI
  111. Examples of UI views:
  112. ** Comment Feed
  113. ** Activity Feed
  114. ** Product List
  115. ## Usage
  116. ### Specification
  117. #### I want to contribute to the spec
  118. 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)