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.

217 lines
7.8 KiB

11 years ago
  1. # Semantic
  2. [![Build Status](https://travis-ci.org/jlukic/Semantic-UI.png)](https://travis-ci.org/jlukic/Semantic-UI)
  3. 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.
  4. ## Development Status
  5. Semantic is production ready, but is formally "pre-release" until proper build and theming tools are available, and documentation is complete for all components.
  6. ### Bugs and Issues
  7. Please [share any issues](https://github.com/jlukic/Semantic-UI/issues?state=open) you may have, we need your help to get all the kinks out.
  8. If you are reporting a bug *you must create a test-case*. You can [fork this jsfiddle](http://jsfiddle.net/jlukic/Vbr9d/1/) to get you started.
  9. ### Roadmap
  10. * [Features Missing for 1.0](https://github.com/jlukic/Semantic-UI/issues?direction=desc&milestone=1&page=1&sort=updated&state=open)
  11. * [Planned Updates for 1.X](https://github.com/jlukic/Semantic-UI/issues?direction=desc&milestone=2&page=1&sort=updated&state=open)
  12. * [Additional Components Scoped for 2.0](https://github.com/jlukic/Semantic-UI/issues?direction=desc&labels=&milestone=3&page=1&sort=updated&state=open)
  13. ### Updates
  14. If you want to keep track of development, please [join our google group](https://groups.google.com/forum/?hl=en#!forum/semantic-ui)
  15. ## The Library
  16. ### Getting Started
  17. 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.
  18. *Build tools are not yet available but stay tuned!*
  19. ~~You can use our build tool to select only the components you want~~
  20. To download the entire library
  21. git clone git@github.com:quirkyinc/semantic.git
  22. If you prefer to download the whole kit as a zip, it is so conveniently packaged.
  23. http://semantic-ui.com/build/semantic.zip
  24. ### Right-to-Left (RTL Version)
  25. RTL versions are compiled on every patch update, and are available in ``/rtl/``
  26. ### LESS Semantic UI
  27. More css-processing features are currently being added to help in the customizing and theming Semantic UI. This will be one of the core features additions for Semantic's first release version.
  28. ### SASS/SCSS Semantic UI
  29. If you are looking for a SCSS/SASS port of Semantic for your rails projects check out doabit's [Semantic UI for SASS](https://github.com/doabit/semantic-ui-sass)
  30. ## The Specification
  31. The aim of the specification is to develop conventions around structuring and naming code for interface elements.
  32. By defining a vocabulary the development community can exchange javascript and css definitions of UI in a similar language, making new code easier to grok, and reducing the complexity of starting a new project, or changing a sites design.
  33. ## Types of UI
  34. UI components are split into four categories, ranging from smallest to largest in scope:
  35. * UI Elements
  36. * UI Collections
  37. * UI Modules
  38. * UI Views
  39. ### UI Elements
  40. 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.
  41. UI elements can have plural definitions when they are known to exist together frequently.
  42. In this case each button will be large because we understand it is a part of the large button group
  43. ``` html
  44. <div class="large ui buttons">
  45. <div class="ui button">Cancel</div>
  46. <div class="ui button">Continue</div>
  47. </div>
  48. ```
  49. Examples of UI elements:
  50. * Buttons
  51. * Labels
  52. * Headers
  53. * Progress bars
  54. ### UI Collections
  55. UI Collections are groups of heteregeneous UI elements which are usually found together. Carrying the chemistry metaphor, these can be thought of as molecules.
  56. 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.
  57. Examples of UI collections:
  58. * Forms
  59. * Tables
  60. * Grids (Layout)
  61. * Menus
  62. ### UI Modules
  63. 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".
  64. Examples of UI modules:
  65. * Popups
  66. * Modals
  67. * Chatrooms
  68. ### UI Views
  69. 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.
  70. Examples of UI views:
  71. * Comment Feed
  72. * Activity Feed
  73. * Product List
  74. ### How it is defined
  75. #### Scope of a definition
  76. **All UI**: The specification defines class name and html structures which can be used to represent an element
  77. **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.
  78. **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.
  79. **Modules**: Module definitions include a list of behaviors that are commonly associated with an element
  80. **Views**: View specifications defines the types of content the view usually display, and the heirarchy typical to presenting this content to the user.
  81. #### Based on class
  82. 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.
  83. #### Context sensitive
  84. 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.
  85. For example, a form you can have a variation called "inverted". This changes the appearance of form elements to work on dark backgrounds.
  86. ```html
  87. <div class="ui inverted form">
  88. <div class="field">
  89. <label>Name</label>
  90. <input type="text">
  91. </div>
  92. </div>
  93. ```
  94. The same variation can also be useful in the context of a menu.
  95. ```html
  96. <div class="ui inverted menu">
  97. <div class="item">Section 1</div>
  98. <div class="ui simple dropdown item">
  99. Dropdown
  100. <div class="menu">
  101. <div class="item">Dropdown item 1</div>
  102. <div class="item">Dropdown item 2</div>
  103. </div>
  104. </div>
  105. </div>
  106. ```
  107. #### Example
  108. Here is part of Semantic's definition of a button
  109. **Standard**: A button is a shape that can be pressed in to complete an action.
  110. ```html
  111. <div class="ui button"></div>
  112. ```
  113. **State**: A button can sometimes be active, designating it is selected by the user.
  114. ```html
  115. <div class="ui active button">
  116. ```
  117. **Variations**: A button may sometimes look different than its prototype.
  118. ```html
  119. <div class="ui large blue icon button">
  120. <i class="ui icon heart"></i>
  121. </div>
  122. ```
  123. **Plurality**: A button can sometimes exist in a group of buttons
  124. ``` html
  125. <div class="ui large blue buttons">
  126. <div class="ui button">
  127. I am blue
  128. </div>
  129. <div class="ui button">
  130. I am blue too
  131. </div>
  132. </div>
  133. ```
  134. ## Usage
  135. ### Developers
  136. Prereqs Node, Grunt(``npm install -g grunt-cli``) and DocPad (``npm install -g docpad``)
  137. Inside ``node/`` use the command ``docpad run`` to start your server
  138. You can then access the docs locally at ``localhost:9778``
  139. To have DocPad watch for changes while working on a component simply run the command
  140. ``grunt``
  141. To build the release packages for Semantic
  142. ``grunt build``
  143. #### I want to contribute to the spec
  144. 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@myfav.es](mailto:jack@myfav.es)