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.

183 lines
6.3 KiB

11 years ago
  1. # Pre-Release (Not ready for usage)
  2. This is a pre-release version of Semantic, many features may be broken or missing. Development on semantic was being done in stealth, but after hackernews/reddit coverage, will continue on more transparently on the march to a version one.point.oh, huzzah!
  3. Documentation is very loose, build tools are not yet available, and APIs may be updated regularly. So be warned!
  4. **Please use at your own discretion.**
  5. ## Semantic
  6. 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.
  7. ## The Library
  8. ### Getting Started
  9. 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.
  10. You can use our build tool to select only the components you want
  11. http://semantic-ui.com/download
  12. Or download the entire library
  13. git clone git@github.com:quirkyinc/semantic.git
  14. If you prefer to download the whole kit and kaboodle as a single javascript include you can grab that as well.
  15. http://semantic-ui.com/ui/semantic.min.css
  16. http://semantic-ui.com/ui/semantic.min.js
  17. ## The Specification
  18. The aim of the specification is to develop conventions around structuring and naming code for interface elements.
  19. By defining a vocabulary the development community can exchange javascript and css definitions of UI in a similar language, making new code easier to grock, and reducing the complexity of starting a new project, or changing a sites design.
  20. ## Types of UI
  21. UI components are split into four categories, ranging from smallest to largest in scope:
  22. * UI Elements
  23. * UI Collections
  24. * UI Modules
  25. * UI Views
  26. ### UI Elements
  27. 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.
  28. UI elements can have plural definitions when they are known to exist together frequently.
  29. In this case each button will be large because we understand it is a part of the large button group
  30. ``` html
  31. <div class="large ui buttons">
  32. <div class="ui button">Cancel</div>
  33. <div class="ui button">Continue</div>
  34. </div>
  35. ```
  36. Examples of UI elements:
  37. * Buttons
  38. * Labels
  39. * Headers
  40. * Progress bars
  41. ### UI Collections
  42. UI Collections are groups of heteregeneous UI elements which are usually found together. Carrying the chemistry metaphor, these can be thought of as molecules.
  43. 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.
  44. Examples of UI collections:
  45. * Forms
  46. * Tables
  47. * Grids (Layout)
  48. * Menus
  49. ### UI Modules
  50. 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".
  51. Examples of UI modules:
  52. * Popups
  53. * Modals
  54. * Chatrooms
  55. * Calendar Pickers
  56. ### UI Views
  57. 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.
  58. Examples of UI views:
  59. * Comment Feed
  60. * Activity Feed
  61. * Product List
  62. ### How it is defined
  63. #### Scope of a definition
  64. **All UI**: The specification defines class name and html structures which can be used to represent an element
  65. **Elements**: An element definition gives states which an elements can occupy, common types of that element, and if necessary, defines how the element functions in groups.
  66. **Collections**: Collection definitions list elements that it can include, and variations which can apply to both the collection, or individual elements found in the collection.
  67. **Modules**: Module definitions include a list of behaviors that are commonly associated with an element
  68. **Views**: View specifications defines the types of content the view usually display, and the heirarchy typical to presenting this content to the user.
  69. #### Based on class
  70. 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.
  71. #### Context sensitive
  72. 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.
  73. For example, a form you can have a variation called "inverted". This changes the appearance of form elements to work on dark backgrounds.
  74. ```html
  75. <div class="ui inverted form">
  76. <div class="field">
  77. <label>Name</label>
  78. <input type="text">
  79. </div>
  80. </div>
  81. ```
  82. The same variation can also be useful in the context of a menu.
  83. ```html
  84. <div class="ui inverted menu">
  85. <div class="item">Section 1</div>
  86. <div class="ui simple dropdown item">
  87. Dropdown
  88. <div class="menu">
  89. <div class="item">Dropdown item 1</div>
  90. <div class="item">Dropdown item 2</div>
  91. </div>
  92. </div>
  93. </div>
  94. ```
  95. #### Example
  96. Here is part of Semantic's definition of a button
  97. **Standard**: A button is a shape that can be pressed in to complete an action.
  98. ```html
  99. <div class="ui button"></div>
  100. ```
  101. **State**: A button can sometimes be active, designating it is selected by the user.
  102. ```html
  103. <div class="ui active button">
  104. ```
  105. **Variations**: A button may sometimes look different than its prototype.
  106. ```html
  107. <div class="ui large blue icon button">
  108. <i class="ui icon heart"></i>
  109. </div>
  110. ```
  111. **Plurality**: A button can sometimes exist in a group of buttons
  112. ``` html
  113. <div class="ui large blue buttons">
  114. <div class="ui button">
  115. I am blue
  116. </div>
  117. <div class="ui button">
  118. I am blue too
  119. </div>
  120. </div>
  121. ```
  122. ## Usage
  123. ### Specification
  124. #### I want to contribute to the spec
  125. 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 [jack@semantic-ui.com](mailto:jack@semantic-ui.com)