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.

151 lines
5.0 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
  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 forms, 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"></div>
  23. ```
  24. The same variation can also be useful in the context of a menu.
  25. ```html
  26. <div class="ui inverted menu"></div>
  27. ```
  28. ### Defining UI
  29. Here is part of Semantic's definition of a button
  30. **Standard**: A button is a shape that can be pressed in to complete an action.
  31. ```html
  32. <div class="ui button"></div>
  33. ```
  34. **State**: A button can sometimes be active, designating it is selected by the user.
  35. ```html
  36. <div class="ui active button">
  37. ```
  38. **Variations**: A button may sometimes look different than its prototype.
  39. ```html
  40. <div class="ui large blue icon button">
  41. <i class="ui icon heart"></i>
  42. </div>
  43. ```
  44. **Plurality**: A button can sometimes exist in a group of buttons
  45. ``` html
  46. <div class="ui large blue buttons">
  47. <div class="ui button">
  48. I am blue
  49. </div>
  50. <div class="ui button">
  51. I am blue too
  52. </div>
  53. </div>
  54. ```
  55. ## Types of UI
  56. UI components are split into four categories, ranging from smallest to largest:
  57. * UI Elements
  58. * UI Collections
  59. * UI Modules
  60. * UI Views
  61. 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.
  62. ### UI Elements
  63. 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.
  64. UI elements can have plural definitions when they are known to exist together frequently.
  65. In this case each button will be large because we understand it is a part of the large button group
  66. ``` html
  67. <div class="large buttons">
  68. <div class="ui button">Cancel</div>
  69. <div class="ui positive button">Continue</div>
  70. </div>
  71. ```
  72. Examples of UI elements:
  73. * Buttons
  74. * Labels
  75. * Headers
  76. * Progress bars
  77. ### UI Collections
  78. UI Collections are groups of heteregeneous UI elements which are usually found together. Carrying the chemistry metaphor, these can be thought of as molecules.
  79. 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.
  80. Examples of UI collections:
  81. * Forms
  82. * Tables
  83. * Grids (Layout)
  84. * Menus
  85. ## UI Modules
  86. 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".
  87. Examples of UI modules:
  88. * Popups
  89. * Modals
  90. * Chatrooms
  91. * Calendar Pickers
  92. ## UI Views
  93. 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.
  94. For example an activity feed in
  95. This is a UI
  96. Examples of UI views:
  97. ** Comment Feed
  98. ** Activity Feed
  99. ** Product List
  100. ## Usage
  101. ### Specification
  102. #### I want to contribute to the spec
  103. 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)