Browse Source

All my writing

intro
Jack Lukic 9 years ago
parent
commit
4b42fb3392
  1. 20
      server/documents/collections/form.html.eco
  2. 76
      server/documents/hotfix.html.eco
  3. 99
      server/documents/introduction/advanced-usage.html.eco
  4. 18
      server/documents/introduction/build-tools.html.eco
  5. 6
      server/documents/introduction/getting-started.html.eco
  6. 53
      server/documents/introduction/new.html.eco
  7. 23
      server/documents/modules/modal.html.eco
  8. 360
      server/documents/usage/theming.html.eco
  9. 14
      server/files/javascript/docs.js
  10. 22
      server/files/javascript/new.js
  11. 4
      server/files/javascript/theming.js
  12. 5
      server/files/stylesheets/docs.css

20
server/documents/collections/form.html.eco

@ -38,10 +38,10 @@ themes : ['Default', 'Flat', 'Chubby', 'GitHub']
<label>Name</label>
<div class="two fields">
<div class="field">
<input type="text" name="first-name" placeholder="First Name">
<input type="text" name="shipping[first-name]" placeholder="First Name">
</div>
<div class="field">
<input type="text" name="last-name" placeholder="Last Name">
<input type="text" name="shipping[last-name]" placeholder="Last Name">
</div>
</div>
</div>
@ -49,10 +49,10 @@ themes : ['Default', 'Flat', 'Chubby', 'GitHub']
<label>Billing Address</label>
<div class="fields">
<div class="twelve wide field">
<input type="text" name="first-name" placeholder="Street Address">
<input type="text" name="shipping[address]" placeholder="Street Address">
</div>
<div class="four wide field">
<input type="text" name="last-name" placeholder="Apt #">
<input type="text" name="shipping[address-2]" placeholder="Apt #">
</div>
</div>
</div>
@ -77,7 +77,7 @@ themes : ['Default', 'Flat', 'Chubby', 'GitHub']
<div class="field">
<label>Card Type</label>
<div class="ui selection dropdown">
<input type="hidden" name="gender">
<input type="hidden" name="card[type]">
<div class="default text">Type</div>
<i class="dropdown icon"></i>
<div class="menu">
@ -99,17 +99,17 @@ themes : ['Default', 'Flat', 'Chubby', 'GitHub']
<div class="fields">
<div class="seven wide field">
<label>Card Number</label>
<input type="text" name="card-number" maxlength="16" placeholder="Card #">
<input type="text" name="card[number]" maxlength="16" placeholder="Card #">
</div>
<div class="three wide field">
<label>CVC</label>
<input type="text" name="cvc" maxlength="3" placeholder="CVC">
<input type="text" name="card[cvc]" maxlength="3" placeholder="CVC">
</div>
<div class="six wide field">
<label>Expiration</label>
<div class="two fields">
<div class="field">
<select class="ui fluid search dropdown" name="expire-month">
<select class="ui fluid search dropdown" name="card[expire-month]">
<option value="">Month</option>
<option value="1">January</option>
<option value="2">February</option>
@ -126,7 +126,7 @@ themes : ['Default', 'Flat', 'Chubby', 'GitHub']
</select>
</div>
<div class="field">
<input type="text" name="expire-year" maxlength="4" placeholder="Year">
<input type="text" name="card[expire-year]" maxlength="4" placeholder="Year">
</div>
</div>
</div>
@ -137,7 +137,7 @@ themes : ['Default', 'Flat', 'Chubby', 'GitHub']
<div class="field">
<label>Send Receipt To:</label>
<div class="ui fluid multiple search selection dropdown">
<input type="hidden" name="user">
<input type="hidden" name="receipt">
<i class="dropdown icon"></i>
<div class="default text">Saved Contacts</div>
<div class="menu">

76
server/documents/hotfix.html.eco

@ -1,16 +1,19 @@
---
layout : 'blank'
css : 'hotfix'
layout : 'blank'
css : 'hotfix'
standalone : true
title : 'Test Page'
type : 'Library'
title : 'Test Page'
type : 'Library'
---
<!-- TEST JS HERE !-->
<script>
$(document).ready(function() {
$('.test.checkbox').checkbox();
$('#aa').dropdown();
$('#theform').form();
});
</script>
@ -21,47 +24,30 @@ $(document).ready(function() {
<div class="ui container" style="margin-top:5em;">
<div class="ui test checkbox">
<input type="checkbox" name="example" />
<label>Initialized</label>
</div>
<div class="ui divider"></div>
<div class="ui checkbox">
<input type="checkbox" />
<label>No JS</label>
</div>
<div class="ui divider"></div>
<div class="ui toggle checkbox">
<input type="checkbox" />
<label>No JS</label>
</div>
<div class="ui divider"></div>
<div class="ui slider checkbox">
<input type="checkbox" />
<label>No JS</label>
</div>
<div class="ui divider"></div>
<div class="ui checkbox">
<input type="checkbox" />
<label>No JS</label>
</div>
<main class="ui grid container">
<div class="row">
<div class="column">
<form class="ui form segment" id="theform">
<div class="field">
<label>label</label>
<div class="ui dropdown search button" id="aa"> <span class="default text">Placeholder...</span>
<input type="hidden" name="field">
<div class="menu">
<div class="item" data-value="a"> <i class="blue cube icon"></i>a</div>
<div class="item" data-value="b"> <i class="blue cube icon"></i>b</div>
<div class="item" data-value="c"> <i class="blue cube icon"></i>c</div>
</div>
</div>
</div>
<div class="ui button reset">Reset</div>
<div class="ui button clear">Clear</div>
<div class="ui button blue">Show</div>
</form>
</div>
</div>
</main>
<div class="ui divider"></div>
<div class="ui checkbox">
<input type="checkbox" id="labeled" name="labeled" />
<label for="labeled">Labeled</label>
</div>
</div>
</body>

99
server/documents/introduction/advanced-usage.html.eco

@ -12,7 +12,7 @@ type : 'Introduction'
<div class="main ui intro container">
<h2 class="ui dividing header">Custom Gulp Pipelines</h2>
<h2 class="ui dividing header">Custom Pipelines</h2>
<div class="no example">
<h4>Importing Gulp Tasks</h4>
<p>You don't have to use <a href="/introduction/build-tools.html">our gulp pipeline</a>, just import the task into your own <code>gulpfile</code></p>
@ -27,9 +27,9 @@ type : 'Introduction'
</div>
</div>
<h2 class="ui dividing header">Component Releases</h2>
<h2 class="ui dividing header">Single Components</h2>
<div class="no example">
<h4>Single Component Repos</h4>
<h4>Tagged Releases</h4>
<p>Component repos are released on NPM and as tagged releases on github.</p>
<p>Check the list of repos available under <a href="https://github.com/Semantic-Org?utf8=%E2%9C%93&query=ui-">Semantic Org</a> on GitHub</p>
<p>Each component's release notes will automatically update with the relevant notes for that component from the main release.</p>
@ -37,9 +37,10 @@ type : 'Introduction'
npm install semantic-ui-component
</div>
</div>
<div class="no example">
<h4>Server-Side Rendering</h4>
<p>Individual components repos include an <code>index.js</code> file to simplify <a href="http://www.sitepoint.com/understanding-module-exports-exports-node-js/" target="_blank"><code>require</code></a> use with NodeJS, for server-side rendering or with <a href="http://browserify.org/" target="_blank">Browserify</a>.</p>
<p>Individual components repos include an <a href="https://github.com/Semantic-Org/Semantic-UI/blob/master/tasks/admin/components/create.js" target="_blank">auto-generated</a> <code>index.js</code> file to simplify <a href="http://www.sitepoint.com/understanding-module-exports-exports-node-js/" target="_blank"><code>require</code></a> use with NodeJS, for server-side rendering or with <a href="http://browserify.org/" target="_blank">Browserify</a>.</p>
<div class="ignored code">
npm install semantic-ui-dropdown
</div>
@ -52,21 +53,24 @@ type : 'Introduction'
</div>
<h2 class="ui dividing header">Importing LESS</h2>
<div class="no example">
<h4>LESS Only Distribution</h4>
<p>A special distribution <a href="https://github.com/Semantic-Org/Semantic-UI-LESS">Semantic-UI-LESS</a> is available for projects that use custom integrations and do not require our build tools.</p>
<h4>All Components</h4>
<div class="ui ignored warning message">LESS source files are not prefixed, and will need to be run through <a href="https://github.com/postcss/autoprefixer">autoprefixer</a> before being used</div>
</div>
<div class="no example">
<h4>Importing Semantic</h4>
<p><code>semantic.less</code> is available in all releases as an entry point for importing multiple components from other LESS files.</p>
<div class="ignored code" data-type="LESS" data-title="Importing LESSS">
/* Import all components */
@import 'src/semantic';
</div>
<p>Before LESS files will work correctly you will to manually rename <code>theme.config.example</code>.
<p>To begin using a site theme you will also need to rename <code>_site/</code> to <code>site/</code>.</p>
<div class="ui ignored warning message">LESS source files are not prefixed, and will need to be run through <a href="https://github.com/postcss/autoprefixer">autoprefixer</a> before being used</div>
</div>
<div class="no example">
<h4>Single Components</h4>
<h4>Importing Components</h4>
<p>If you need to import individual components, you should scope each import to avoid inheritance issues.</p>
<div class="ignored code" data-type="LESS" data-title="Importing LESS Components">
/* Import specific components with scope */
@ -75,4 +79,81 @@ type : 'Introduction'
</div>
</div>
<h2 class="ui dividing header">Running Docs Locally</h2>
<div class="no example">
<h4>Download Docs Server</h4>
<p>The easiest way to get <a href="https://github.com/Semantic-Org/Semantic-UI-Docs/">Semantic UI docs</a> is to clone the repo</p>
<div class="code">
git clone git@github.com:Semantic-Org/Semantic-UI-Docs.git
</div>
</div>
<div class="no example">
<h4>Install Dependencies</h4>
<p>Semantic UI's documentation is written in <a href="http://www.docpad.org" target="_blank">Docpad</a> an amazing static site generator built in NodeJS</p>
<div class="code">
cd docs/
npm install
</div>
</div>
<div class="no example">
<h4>A Note About Paths</h4>
<p>Semantic UI's <a href="introduction/build-tools.html">build tools</a> include two special commands <code>build-docs</code> and <code>serve-docs</code> for use with the documentation. These will pass changes from the ui/ folder directly to a live docs server.</p>
<p>These gulp tasks expect two sibling folders</p>
<div class="ui list">
<div class="item">
<i class="folder icon"></i>
<div class="content">
<div class="header">ui/</div>
<div class="description">Files from semantic ui repo</div>
</div>
</div>
<div class="item">
<i class="folder icon"></i>
<div class="content">
<div class="header">docs/</div>
<div class="description">Files from docs repo</div>
</div>
</div>
</div>
</div>
<div class="no example">
<h4>Build UI</h4>
<p>The first time you run docs you will need to build the whole project once</p>
<div class="code">
cd ui/
gulp build-docs
</div>
</div>
<div class="no example">
<h4>Run Docpad Server</h4>
<p>Docpad</p>
<div class="code">
cd docs/
# initial build may take several minutes
docpad run
</div>
</div>
<div class="no example">
<h4>Serve UI to Docs</h4>
<p>You can then continue to make modifications to UI and "serve" these files to a live docs instance to see your changes immediately</p>
<div class="code">
cd ui/
gulp build-docs
</div>
</div>
<div class="no example">
<h4>Hosted Docs</h4>
<p>If you are managing your documentation you can automatically deploy to github pages using a built in <a href="https://github.com/docpad/docpad-plugin-ghpages">docpad gh-pages</a> plugin</p>
<p>For more information about GitHub pages, check out the <a href="https://pages.github.com/" target="_blank">docs on GitHub</a></p>
<div class="code">
docpad deploy-ghpages --env static
</div>
</div>
<div class="no example">
<h4>Custom Docs Paths</h4>
<p>Doc task paths are specified in a file <a href="https://github.com/Semantic-Org/Semantic-UI/blob/master/tasks/config/docs.js"><code>tasks/config/docs.js</code></a> and can be adjusted to use any folder set-up necessary for your project.</p>
</div>
</div>

18
server/documents/introduction/build-tools.html.eco

@ -14,6 +14,20 @@ type : 'Introduction'
<h2 class="ui dividing header">Overview</h2>
<div class="no example">
<h4>30 Second Explanation</h4>
<p><a href="/introduction/getting-started.html">Download Semantic UI</a> navigate to the install folder then run a <a href="#gulp-commands">gulp command</a>.</p>
<p>To build all files:</p>
<div class="code" data-type="bash">
gulp build
</div>
<p>To watch for changes</p>
<div class="code" data-type="bash">
gulp watch
</div>
</div>
<div class="no example">
<h4>Why Build Tools?</h4>
<p>Semantic UI uses Gulp for several reasons:</p>
@ -102,7 +116,7 @@ type : 'Introduction'
</div>
</div>
<div class="no example">
<h4>Available Commands</h4>
<h4>Gulp Commands</h4>
<p>Below is a list of all available gulp commands</p>
<table class="ui definition table">
<thead>
@ -112,7 +126,7 @@ type : 'Introduction'
<tbody>
<tr>
<td>install</td>
<td>Asks install questions will automatically run if not setup.</td>
<td>Asks install questions to setup semantic.json</td>
</tr>
<tr>
<td>watch (default)</td>

6
server/documents/introduction/getting-started.html.eco

@ -10,7 +10,7 @@ type : 'Introduction'
---
<script src="/javascript/started.js"></script>
<%- @partial('header', { tabs: { install: 'Install', packages: 'Other Packages' } }) %>
<%- @partial('header') %>
<div class="main ui intro container">
@ -22,8 +22,8 @@ type : 'Introduction'
<h4 class="ui header">Using Build Tools</h4>
<p>Semantic UI uses css variables to let users manage <a href="/usage/theming.html">user themed</a> versions of components. Build tools are included in Semantic UI to help compile themed files for your project.</p>
<p>The easiest way to install Semantic UI is our NPM package which contains special install scripts to make setup and updates seamless.</p>
<p>Semantic UI packaged Gulp build tools so your project can preserve its <a href="/usage/theming.html">own theme changes</a>.</p>
<p>The easiest way to install Semantic UI is our NPM package which contains special install scripts to make setup interactive and updates seamless.</p>
<p>For installing with specific integrations like, Ember, React, or Meteor, see our <a href="/introduction/integrations.html">integration guide</a></p>
<p>For integrating Semantic UI tasks into your own build tools see our <a href="/introduction/advanced-usage.html">advanced usage</a> section.</p>

53
server/documents/introduction/new.html.eco

@ -45,8 +45,8 @@ type : 'Main'
</div>
<div class="colored example">
<h4 class="ui header">New Colors</h4>
<p><code>2.0</code> includes additional named colors olive, violet, brown and grey which help provide more expressiveness with color variations.</p>
<h4 class="ui header">Complete Spectrum</h4>
<p>Semantic now includes twelve named colors, enough for most languages to <a href="https://en.wikipedia.org/wiki/Linguistic_relativity_and_the_color_naming_debate#Berlin_and_Kay" target="_blank">distinguish between colors</a>. New in 2.0 are: olive, violet, brown and grey.</p>
<a class="ui grey label">Grey</a>
<a class="ui red pointing label">Red</a>
<a class="ui orange tag label">Orange</a>
@ -82,6 +82,15 @@ type : 'Main'
</div>
</div>
</div>
<div class="example">
<h4 class="ui header">New Default Theme</h4>
<p>All components have received a face-lift for 2.0. Styles give slightly more negative space and a few idiosyncratic design touches have been removed.</p>
</div>
<div class="example">
<h4 class="ui header">More Precise EM Values</h4>
<p>EM sizing has been improved in 2.0, with all values rounding to exact pixel values. This helps common relative sizing pitfalls like rounding errors in vertical alignment.</p>
</div>
<h2 class="ui dividing header">Grids</h2>
@ -264,7 +273,7 @@ type : 'Main'
</div>
<div class="dropdown example">
<h4 class="ui header">Scrolling and Nested Menus</h4>
<h4 class="ui header">Scrolling Menus</h4>
<p><a href="modules/dropdown.html#scrolling">Scrolling menu</a> and nested menus are now supported.</p>
<p>Listing choices in a nested menu will still give all the same keyboard shortcuts and filtering as regular menus.</p>
<div class="ui floating dropdown labeled icon button">
@ -492,6 +501,44 @@ type : 'Main'
</div>
<h2 class="ui dividing header">Form</h2>
<div class="form example">
<h4 class="ui header">Autocomplete</h4>
<p>Form now include custom styling for browser <a href="https://developers.google.com/web/fundamentals/input/form/label-and-name-inputs?hl=en">autocompleted form fields</a>. Autocompleted fields can also specify focused autocomplete, and errored autocomplete styles.</p>
<form class="ui form" method="post" action="#autocomplete">
<h4 class="ui dividing header">Shipping Information</h4>
<div class="field">
<label>Name</label>
<div class="two fields">
<div class="field">
<input type="text" name="shipping[first-name]" placeholder="First Name" autocomplete="given-name">
</div>
<div class="field">
<input type="text" name="shipping[last-name]" placeholder="Last Name" autocomplete="family-name">
</div>
</div>
</div>
<div class="field">
<label>Address</label>
<div class="fields">
<div class="eight wide field">
<input type="text" name="shipping[address]" placeholder="Street Address" autocomplete="address-line1">
</div>
<div class="four wide field">
<input type="text" name="shipping[address-2]" placeholder="Apt #" autocomplete="address-line2">
</div>
<div class="four wide field">
<input type="text" name="shipping[zip]" placeholder="Zipcode" autocomplete="postal-code">
</div>
</div>
</div>
<div class="ui submit button">Submit</div>
</form>
</div>
<h2 class="ui dividing header">Dimmer</h2>

23
server/documents/modules/modal.html.eco

@ -208,7 +208,7 @@ themes : ['Default', 'Material']
<h2 class="ui dividing header">Types</h2>
<div class="example">
<h4 class="ui header">Standard</h4>
<h4 class="ui header">Modal</h4>
<p>A standard modal</p>
<div class="code" data-demo="true" data-eval="$('.standard.test.modal').modal('show');">
$('.ui.modal')
@ -408,6 +408,27 @@ themes : ['Default', 'Material']
<h2 class="ui dividing header">Examples</h2>
<div class="no example">
<h4 class="ui header">Dimmer Variations</h4>
<p>Modals can specify additional variations like <code>blurring</code> or <code>inverted</code> which adjust how the dimmer displays.</p>
<div class="code" data-demo="true">
$('.small.modal')
.modal({
inverted: true
})
.modal('show')
;
</div>
<div class="code" data-demo="true">
$('.small.modal')
.modal({
blurring: true
})
.modal('show')
;
</div>
</div>
<div class="no example">
<h4 class="ui header">Scrolling Modal</h4>
<p>When your modal content exceeds the height of the browser the scrollable area will automatically expand to include just enough space for scrolling, without scrolling the page below.</p>

360
server/documents/usage/theming.html.eco

@ -15,6 +15,7 @@ type : 'Usage'
<link rel="stylesheet/less" type="text/css" href="/src/definitions/globals/site.less" />
<link rel="stylesheet/less" type="text/css" href="/src/definitions/elements/button.less" />
<link rel="stylesheet/less" type="text/css" href="/src/definitions/modules/checkbox.less" />
<div class="main ui intro container">
@ -35,23 +36,124 @@ type : 'Usage'
<p>Instead of having to create components from a blank canvas, developers using Semantic UI only need to specify how their components should differ from the default theme using <a href="http://lesscss.org/features/#variables-feature" target="_blank">CSS variables</a>.</p>
</div>
<h2 class="ui dividing header">
Themes
Examples
</h2>
<div class="no example">
<h3 class="ui header">Parts of a Theme</h3>
<h4>Global Inheritance</h4>
<p>Themes are made up of two files a <code>.variables</code> file and a <code>.overrides</code> file.</p>
<p>Semantic UI includes twelve named colors. Components with color variations inherit these global variables when defining how colors should appear.</p>
<p>A <b>.variables</b> file specifies variables which should be adjusted for a theme.</p>
<p>Each level of inheritance can includes a global file <code>site.variables</code> which can define theme-wide defaults that each component can extend.</p>
<p>An <b>.overrides</b> file adds additional css rules from the baseline definition which should be included with an element. This file also has access to all inherited variables for a component.</p>
<div class="ui ignored code" data-type="less" data-less="true" data-title="site/globals/site.variables">
@primaryColor: @pink;
@secondaryColor: @grey;
@red : #B03060;
@orange : #FE9A76;
@yellow : #FFD700;
@olive : #32CD32;
@green : #016936;
@teal : #008080;
@blue : #0E6EB8;
@violet : #EE82EE;
@purple : #B413EC;
@pink : #FF1493;
@brown : #A52A2A;
@grey : #A0A0A0;
@black : #000000;
</div>
<button class="ui primary button">
Primary Button
</button>
<button class="ui secondary button">
Secondary Button
</button>
<div class="ui horizontal divider">All Colors</div>
<button class="ui red button">Red</button>
<button class="ui orange button">Orange</button>
<button class="ui yellow button">Yellow</button>
<button class="ui olive button">Olive</button>
<button class="ui green button">Green</button>
<button class="ui teal button">Teal</button>
<button class="ui blue button">Blue</button>
<button class="ui violet button">Violet</button>
<button class="ui purple button">Purple</button>
<button class="ui pink button">Pink</button>
<button class="ui brown button">Brown</button>
<button class="ui grey button">Grey</button>
<button class="ui black button">Black</button>
</div>
<div class="no example">
<h4>Component Inheritance</h4>
<p>Components inherit default values from <code>site.variables</code> which they may redefine specifically for their component</p>
<p>For example, you could decide that instead of the boring default grey checkboxes, you want yours to include your site's branded colors</p>
<div class="ui ignored code" data-type="less" data-less="true" data-title="site/modules/checkbox.variables">
/* Checkbox */
@checkboxActiveBackground: @primaryColor;
@checkboxActiveBorderColor: @primaryColor;
@checkboxActiveCheckColor: @white;
@checkboxTransition: none;
/* Slider */
@sliderOnLineColor: @primaryColor;
/* Radio */
@radioActiveBackground: @primaryColor;
</div>
<div class="ui checkbox">
<input type="checkbox" name="checkbox" checked >
<label>Checkbox</label>
</div>
<div class="ui hidden divider"></div>
<div class="ui form">
<div class="inline fields">
<div class="field">
<div class="ui radio checkbox">
<input type="radio" name="radio" checked />
<label>A</label>
</div>
</div>
<div class="field">
<div class="ui radio checkbox">
<input type="radio" name="radio" />
<label>B</label>
</div>
</div>
<div class="field">
<div class="ui radio checkbox">
<input type="radio" name="radio" />
<label>C</label>
</div>
</div>
<div class="field">
<div class="ui radio checkbox">
<input type="radio" name="radio" />
<label>D</label>
</div>
</div>
</div>
</div>
<div class="ui hidden divider"></div>
<div class="ui slider checkbox">
<input type="checkbox" name="slider" checked>
<label>Slider</label>
</div>
</div>
<h2 class="ui dividing header">
Anatomy of a Component
</h2>
<div class="no example">
<h4 class="ui header">Inheritance</h4>
<p>Theming variables contain three separate levels of inheritance.</p>
<p>Each step represents a different level of permanence for a variable.</p>
<h4 class="ui header">Themes</h4>
<p>Themes contain three separate levels of variable inheritance.</p>
<p>Each of these let developers store a different level level of permanence for a variable.</p>
<div class="ui fluid steps">
<div class="step">
<i class="lock icon"></i>
@ -64,19 +166,204 @@ type : 'Usage'
<i class="download icon"></i>
<div class="content">
<div class="title">Packaged Theme</div>
<div class="description">Packagable Component</div>
<div class="description">Distributable Packages</div>
</div>
</div>
<div class="step">
<div class="step">
<i class="user icon"></i>
<div class="content">
<div class="title">Site Theme</div>
<div class="description">Per-Site Changes</div>
<div class="description">Site Specific Changes</div>
</div>
</div>
</div>
</div>
<div class="no example">
<h4 class="ui header">Default Theme</h4>
<p><code>src/themes/default/{type}/{element}</code></p>
<div class="ui list">
<div class="item">
<i class="folder icon"></i>
<div class="content">
<div class="header">src</div>
<div class="list">
<div class="item">
<i class="folder icon"></i>
<div class="content">
<div class="header">themes</div>
<div class="description"></div>
<div class="list">
<div class="item">
<i class="folder icon"></i>
<div class="content">
<div class="header">default</div>
<div class="description">Default theme</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<p>The default theme provides baseline variables for a component.</p>
<p>The best way to understand what variables are available to be used with a component is to examine a components default variables file.</p>
</div>
<div class="no example">
<h4 class="ui header">Packaged Theme</h4>
<p><code>src/themes/theme-name/{type}/{element}.variables</code></p>
<p><code>src/themes/theme-name/{type}/{element}.overrides</code></p>
<div class="ui list">
<div class="item">
<i class="folder icon"></i>
<div class="content">
<div class="header">src</div>
<div class="list">
<div class="item">
<i class="folder icon"></i>
<div class="content">
<div class="header">themes</div>
<div class="description"></div>
<div class="list">
<div class="item">
<i class="folder icon"></i>
<div class="content">
<div class="header">theme_name</div>
<div class="description">Theme called "theme-name"</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<p>Packaged themes are themes bundled together in a folder for distribution. These can be downloaded from the internet, or passed between projects.</p>
<p>Packaged themes are specified by name in your <a href="#theme-config">theme.config</a> file.</p>
</div>
<div class="no example">
<h4 class="ui header">Site Theme</h4>
<p><code>src/site/{type}/{element}</code></p>
<div class="ui list">
<div class="item">
<i class="folder icon"></i>
<div class="content">
<div class="header">src</div>
<div class="list">
<div class="item">
<i class="folder icon"></i>
<div class="content">
<div class="header">themes</div>
<div class="description"></div>
<div class="list">
<div class="item">
<i class="folder icon"></i>
<div class="content">
<div class="header">github</div>
<div class="description">Theme called "github"</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<p>A site theme, not to be mistaken with <code>site.variables</code> a file located in every theme, is a special user theme that can be loaded on top of all other themes.</p>
<p>This is the best location to store changes that will be used on a single site. A site theme can be thought of as similar to a <a href="https://codex.wordpress.org/Child_Themes" target="_blank">child theme</a> in Wordpress.</p>
<p>Theme files <b>are optional includes</b> and can be safely removed if you do not need to add additional changes to a component your project</p>
</div>
<div class="no example">
<h4 class="ui header">Definition File</h4>
<p>Each component includes a source css and javascript file which declares how a components variables should affect its display on screen.</p>
<p>Navigating definition files are a great way for developers who are comfortable with css to get an idea of how themes affect a components display</p>
<p>Here's an abridged version of <a href="/elements/button.html">button</a> with an explanation of each section of the file.</p>
<div class="code" data-type="less" data-title="src/definitions/elements/button.less">
/*******************************
Theme
*******************************/
/* Define type and element to help locate theme files */
@type : 'element';
@element : 'button';
/* Processes Variable Inheritance */
@import (multiple) '../../theme.config';
/* Create scope */
& {
/*******************************
Button
*******************************/
/* Define Component */
.ui.button {
cursor: pointer;
display: inline-block;
min-height: 1em;
outline: none;
border: none;
vertical-align: @verticalAlign;
background: @background;
color: @textColor;
font-family: @fontFamily;
margin: 0em @horizontalMargin @verticalMargin 0em;
padding: @verticalPadding @horizontalPadding (@verticalPadding + @shadowOffset);
text-transform: @textTransform;
text-shadow: @textShadow;
font-weight: @fontWeight;
line-height: @lineHeight;
font-style: normal;
text-align: center;
text-decoration: none;
border-radius: @borderRadius;
box-shadow: @boxShadow;
user-select: none;
transition: @transition;
will-change: @willChange;
-webkit-tap-highlight-color: @tapColor;
}
/* Additional css removed for brevity */
/* Load CSS Overrides and Inline */
.loadUIOverrides();
}
</div>
</div>
<div class="no example">
<h3 class="ui header">Theme Files</h3>
<p>Themes are made up of two files a <code>.variables</code> file and a <code>.overrides</code> file. A theme can include both variables and overrides, or just either one alone.</p>
<p>A <b>.variables</b> file specifies variables which should be adjusted for a theme.</p>
<p>An <b>.overrides</b> file adds additional css rules from the baseline definition which should be included with an element. This file also has access to all inherited variables for a component.</p>
<p>Theme files correspond to the name of the component, for example button's site theme would be located at <code>src/site/elements/button.variables</code></p>
</div>
<div class="no example">
<h4 class="ui header">File Locations</h4>
@ -129,55 +416,4 @@ type : 'Usage'
</div>
</div>
<h2 class="ui dividing header">
Examples
</h2>
<div class="no example">
<h4>A Simple Example</h4>
<p>Semantic UI includes thirteen named colors. Components with <code>color variations</code> inherit these global variables when defining how colors should appear.</p>
<p>Most websites will use a different definition of how these colors should appear. Each theme includes a global file <code>site.variables</code> which can be used to define global variables that each component can use or extend.</p>
<div class="ui ignored code" data-type="less" data-less="true" data-title="site/globals/site.variables">
@primaryColor: @pink;
@secondaryColor: @grey;
@red : #B03060;
@orange : #FE9A76;
@yellow : #FFD700;
@olive : #32CD32;
@green : #016936;
@teal : #008080;
@blue : #0E6EB8;
@violet : #EE82EE;
@purple : #B413EC;
@pink : #FF1493;
@brown : #A52A2A;
@grey : #A0A0A0;
@black : #000000;
</div>
<button class="ui primary button">
Primary Button
</button>
<button class="ui secondary button">
Secondary Button
</button>
<div class="ui horizontal divider">All Colors</div>
<button class="ui red button">Red</button>
<button class="ui orange button">Orange</button>
<button class="ui yellow button">Yellow</button>
<button class="ui olive button">Olive</button>
<button class="ui green button">Green</button>
<button class="ui teal button">Teal</button>
<button class="ui blue button">Blue</button>
<button class="ui violet button">Violet</button>
<button class="ui purple button">Purple</button>
<button class="ui pink button">Pink</button>
<button class="ui brown button">Brown</button>
<button class="ui grey button">Grey</button>
<button class="ui black button">Black</button>
</div>
</div>

14
server/files/javascript/docs.js

@ -762,10 +762,15 @@ semantic.ready = function() {
$html = $('<div class="html">').insertBefore($annotation);
$label = $('<div class="ui top attached label">').html('Example');
$label.prependTo($html);
$demo
.detach()
.prependTo($html)
;
if($demo.length === 0) {
$html.addClass('empty');
}
else {
$demo
.detach()
.prependTo($html)
;
}
}
// create code inside annotation wrapper
@ -971,7 +976,6 @@ semantic.ready = function() {
formattedCode = $.trim(code).replace(whiteSpace, '\n');
}
// color code
formattedCode = window.hljs.highlightAuto(formattedCode);

22
server/files/javascript/new.js

@ -20,6 +20,28 @@ semantic.new.ready = function() {
};
// form
$('.form.example .ui.dropdown')
.dropdown()
;
// form
$('.form.example')
.form({
inline: true,
fields: {
firstName: {
identifier : 'shipping[first-name]',
rules: [
{
type : 'isExactly[Suzy]',
prompt : 'Your name must be "Suzy"'
}
]
}
}
})
;
// dimmer
$('.blurring.example .card .dimmer')
.dimmer({

4
server/files/javascript/theming.js

@ -12,6 +12,10 @@ semantic.theming.ready = function() {
};
$('.main .ui.checkbox')
.checkbox()
;
$('.load.button')
.dropdown({
fireOnInit: true,

5
server/files/stylesheets/docs.css

@ -685,7 +685,7 @@ blockquote .author {
/* Message */
#example .example .anchor + p + .ignored.message:not(.attached),
#example .example .anchor + p + .ignored.message + .ignored.message:not(.attached) {
margin: -1.1em 0 2em;
margin: 0em 0 2em;
}
#example .pushing.example .rail .sticky {
@ -910,6 +910,9 @@ blockquote .author {
background-color: #F8F8F8;
box-shadow: 0px 0px 0px 1px #DDDDDD;
}
#example .example > .empty.html.segment {
padding: 1.15em 1em 1em;
}
#example .example > .html.segment > .attached.label {
display: block;
}

Loading…
Cancel
Save