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.

127 lines
4.5 KiB

9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
  1. ## Setup
  2. ### Built-In Tools
  3. From the Semantic directory you can setup gulp to build Semantic by running.
  4. ```bash
  5. npm install
  6. ```
  7. Semantic will automatically configure itself using a `post-install` script built into the package.
  8. After set-up can use gulp to build your project's css:
  9. ```bash
  10. /* Watch files */
  11. gulp watch
  12. /* Build all files */
  13. gulp build
  14. ```
  15. Visit the [Getting Started Guide](http://learnsemantic.com/guide/expert.html) for more details on set-up
  16. ### Custom Pipelines
  17. #### Importing Gulp Tasks
  18. Each gulp task can be imported into your own Gulpfile using `require`
  19. ```javascript
  20. var
  21. watch = require('path/to/semantic/tasks/watch')
  22. ;
  23. gulp.task('watch ui', 'Watch Semantic UI', watch));
  24. ```
  25. #### Importing LESS
  26. > LESS files do not contain vendor prefixes. If you are to use these files directly you must add them during your build step.
  27. Before using source files you will need to create a `theme.config` by renaming `theme.config.example`, and a site folder by renaming `_site/` to `site/`
  28. You can then import Semantic from your own LESS files:
  29. ```less
  30. /* Import all components */
  31. @import 'src/semantic';
  32. ```
  33. To import individual components you will have to create a scope for each import using `& {}`
  34. ```less
  35. /* Import a specific component */
  36. & { @import 'src/definitions/elements/button'; }
  37. ```
  38. ### Config Files
  39. These files are generated automatically using install scripts, but must be manually renamed if you are using installing manually.
  40. filename | usage | Initial Name
  41. --- | --- | ---
  42. **theme.config** | config file that stores each element's current theme for LESS | theme.config.example
  43. **site/** | folder storing all your site's variables and css overrides for each UI component | _site/
  44. **semantic.json** | stores folder paths for build tools and current installed version for updates. Only necessary when using build tools | semantic.json.example
  45. ### Workflow
  46. You will only need to use Semantic's build tools while refining your UI. When designing pages, you can rely on the compiled css packages in `dist/`.
  47. When creating your UI you can try <a href="http://www.learnsemantic.com/themes/creating.html">downloading different themes</a>, adjusting your <a href="http://www.learnsemantic.com/developing/customizing.html#setting-global-variables">site-wide settings</a> (font-family, colors, etc) and tweaking components in your site's <a href="http://www.learnsemantic.com/developing/customizing.html#designing-for-the-long-now">component overrides</a>.
  48. Files in the `examples/` folder of your project can be useful for testing out changes in your UI. For example, you might run `gulp watch` download a new theme to `src/site/themes/` then adjust your `theme.config` file with the name of the new theme and refresh `examples/kitchensink.html` to inspect changes in the theme.
  49. ## Theming
  50. ### Concepts
  51. #### Inheritance
  52. There are three levels of inheritance in Semantic
  53. * Default theme - Semantic UI's neutral default theme
  54. * Packaged theme - A specified packaged theme, like "amazon", or "material"
  55. * Site theme - A theme specific to your site
  56. #### Folder Structure
  57. * `definitions/` contains the `css` and `javascript` definitions for each component
  58. * `themes/` contains *pre-packaged themes* including Semantic's default theme
  59. * `site/` contains your current site's theme
  60. View the [Theming Guide](http://learnsemantic.com/themes/overview.html) for a more in-depth look
  61. ## Customizing
  62. #### Basic Customization
  63. The best way to start customizing is to specify overriding variables in your site's `site.variables` file.
  64. This is a blank stub file that lets you specify variables that overriding variables.
  65. Some important values to customize:
  66. * Base font size
  67. * Named color hex codes
  68. * Header/Page Font-families
  69. * Primary and secondary colors
  70. * Grid column count
  71. To find out what variables are available to modify, you can inspect the variables in the default theme in `themes/default/`
  72. #### Advanced Configuration
  73. Each component has its own variable file, which can be used to modify any of the underlying variables for that component.
  74. For example `/site/elements/button.variables`.
  75. You may also specify your own custom LESS in `site/elements/button.overrides`. This file will have access to all underlying variables available for that component.
  76. #### Using Pre-Packaged Themes
  77. You can modify `theme.config` to use any prepackaged theme available in `src/themes/`.
  78. For example you can modify `theme.config` to use a `github` button theme by changing
  79. ```less
  80. @button: 'github';
  81. ```
  82. View the [Customization Guide](http://learnsemantic.com/developing/customizing.html) to learn more