Browse Source

More writing

intro
Jack Lukic 9 years ago
parent
commit
7cfa33646b
  1. 2
      server/documents/elements/button.html.eco
  2. 26
      server/documents/introduction/build-tools.html.eco
  3. 245
      server/documents/usage/theming.html.eco
  4. 1008
      server/files/javascript/library/less.js
  5. 12
      server/files/javascript/library/less.min.js

2
server/documents/elements/button.html.eco

@ -29,7 +29,7 @@ themes : ['Default', 'Classic', 'Basic', 'Bootstrap3', 'Twitter', 'Raised',
</div> </div>
<div class="another example"> <div class="another example">
<div class="ui ignored warning message"> <div class="ui ignored warning message">
Although any tag can be used for a button, it will only be <a href="http://webaim.org/techniques/keyboard/tabindex">keyboard focusable</a> if you use a <code>&#x3C;button&#x3E;</code> tag or you add the property <code>tabindex="0"</code>. Although any tag can be used for a button, it will only be <a href="http://webaim.org/techniques/keyboard/tabindex">keyboard focusable</a> if you use a <code>&#x3C;button&#x3E;</code> tag or you add the property <code>tabindex="0"</code>. Keyboard accessible buttons will preserve focus styles after click, which may be visually jarring.</p>
</div> </div>
<button class="ui button"> <button class="ui button">
Button Button

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

@ -33,7 +33,7 @@ type : 'Introduction'
<p>Semantic UI uses Gulp for several reasons:</p> <p>Semantic UI uses Gulp for several reasons:</p>
<div class="ui large bulleted list"> <div class="ui large bulleted list">
<div class="item">Process LESS files with <a href="/usage/theming.html">theming variables</a></div> <div class="item">Process LESS files with <a href="/usage/theming.html">theming variables</a></div>
<div class="item">Add vendor prefixes for supported browsers with <a href="https://github.com/postcss/autoprefixer" target="_blank">autoprefixer</a></div> <div class="item">Add vendor prefixes for <a href="https://github.com/Semantic-Org/Semantic-UI/blob/master/tasks/config/project/tasks.js#L96">supported browsers</a> with <a href="https://github.com/postcss/autoprefixer" target="_blank">autoprefixer</a></div>
<div class="item">Watch file changes and rebuild the necessary files when adjusting themes</div> <div class="item">Watch file changes and rebuild the necessary files when adjusting themes</div>
<div class="item">Automatically process asset paths, so that minified and concatenated releases can exist in different directories</div> <div class="item">Automatically process asset paths, so that minified and concatenated releases can exist in different directories</div>
<div class="item">Allow custom builds with only the required components for your site</div> <div class="item">Allow custom builds with only the required components for your site</div>
@ -42,18 +42,17 @@ type : 'Introduction'
</div> </div>
<div class="no example"> <div class="no example">
<h3 class="ui header">Folder Structure</h3> <h3 class="ui header">Folder Structure</h3>
<p>A Semantic UI project includes the following folder structure</p> <p>A Semantic UI project includes the following folder structure.</p>
<div class="ui list"> <div class="ui list">
<div class="item"> <div class="item">
<i class="folder icon"></i> <i class="folder icon"></i>
<div class="content"> <div class="content">
<div class="header">src</div> <div class="header">src</div>
<div class="description">Source files for project</div>
<div class="list"> <div class="list">
<div class="item"> <div class="item">
<i class="folder icon"></i> <i class="folder icon"></i>
<div class="content"> <div class="content">
<div class="header">site</div> <a href="/usage/theming.html#site-theme" class="header">site</a>
<div class="description">Your site's theme</div> <div class="description">Your site's theme</div>
</div> </div>
</div> </div>
@ -61,19 +60,18 @@ type : 'Introduction'
<i class="folder icon"></i> <i class="folder icon"></i>
<div class="content"> <div class="content">
<div class="header">themes</div> <div class="header">themes</div>
<div class="description">Named theme packages</div>
<div class="list"> <div class="list">
<div class="item"> <div class="item">
<i class="folder icon"></i> <i class="folder icon"></i>
<div class="content"> <div class="content">
<div class="header">default</div> <a href="/usage/theming.html#default-theme" class="header">default</a>
<div class="description">Default theme</div> <div class="description">Default theme</div>
</div> </div>
</div> </div>
<div class="item"> <div class="item">
<i class="folder icon"></i> <i class="folder icon"></i>
<div class="content"> <div class="content">
<div class="header">my_theme</div> <a href="/usage/theming.html#packaged-theme" class="header">packaged-theme</a>
<div class="description">Additional themes</div> <div class="description">Additional themes</div>
</div> </div>
</div> </div>
@ -103,6 +101,20 @@ type : 'Introduction'
<div class="description">Individual component css and js</div> <div class="description">Individual component css and js</div>
</div> </div>
</div> </div>
<div class="item">
<i class="file icon"></i>
<div class="content">
<div class="header">semantic.css</div>
<div class="description">concatenated release</div>
</div>
</div>
<div class="item">
<i class="file icon"></i>
<div class="content">
<div class="header">semantic.js</div>
<div class="description">concatenated release</div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>

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

@ -38,7 +38,7 @@ type : 'Usage'
<h2 class="ui dividing header"> <h2 class="ui dividing header">
Examples Lead By Example
</h2> </h2>
<div class="no example"> <div class="no example">
<h4>Global Inheritance</h4> <h4>Global Inheritance</h4>
@ -102,7 +102,7 @@ type : 'Usage'
@sliderOnLineColor: @primaryColor; @sliderOnLineColor: @primaryColor;
/* Radio */ /* Radio */
@radioActiveBackground: @primaryColor; @radioActiveBulletColor: @primaryColor;
</div> </div>
<div class="ui checkbox"> <div class="ui checkbox">
<input type="checkbox" name="checkbox" checked > <input type="checkbox" name="checkbox" checked >
@ -146,14 +146,104 @@ type : 'Usage'
</div> </div>
</div> </div>
<h2 class="ui dividing header">
Composing a Component
</h2>
<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">
<h4 class="ui header">Theme Files</h4>
<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>
<h2 class="ui dividing header"> <h2 class="ui dividing header">
Anatomy of a Component Cascading Inheritance
</h2> </h2>
<div class="no example"> <div class="no example">
<h4 class="ui header">Themes</h4> <h4 class="ui header">Themes</h4>
<p>Themes contain three separate levels of variable inheritance.</p> <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> <p>Each level of inheritance corresponds to a different level of permanence for a variable.</p>
<div class="ui fluid steps"> <div class="ui fluid steps">
<div class="step"> <div class="step">
<i class="lock icon"></i> <i class="lock icon"></i>
@ -181,7 +271,6 @@ type : 'Usage'
<div class="no example"> <div class="no example">
<h4 class="ui header">Default Theme</h4> <h4 class="ui header">Default Theme</h4>
<p><code>src/themes/default/{type}/{element}</code></p>
<div class="ui list"> <div class="ui list">
<div class="item"> <div class="item">
<i class="folder icon"></i> <i class="folder icon"></i>
@ -209,13 +298,11 @@ type : 'Usage'
</div> </div>
</div> </div>
<p>The default theme provides baseline variables for a component.</p> <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> <p>The best way to understand what variables are available for inclusion in a theme is to examine a component's default <code>.variables</code> file.</p>
</div> </div>
<div class="no example"> <div class="no example">
<h4 class="ui header">Packaged Theme</h4> <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="ui list">
<div class="item"> <div class="item">
<i class="folder icon"></i> <i class="folder icon"></i>
@ -242,13 +329,12 @@ type : 'Usage'
</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 themes bundled together in a folder for distribution. These can be downloaded from the internet, or carried between projects.</p>
<p>Packaged themes are specified by name in your <a href="#theme-config">theme.config</a> file.</p> <p>Packaged themes can be used by modifying values in your <a href="#theme-config">theme.config</a> file.</p>
</div> </div>
<div class="no example"> <div class="no example">
<h4 class="ui header">Site Theme</h4> <h4 class="ui header">Site Theme</h4>
<p><code>src/site/{type}/{element}</code></p>
<div class="ui list"> <div class="ui list">
<div class="item"> <div class="item">
<i class="folder icon"></i> <i class="folder icon"></i>
@ -279,141 +365,4 @@ type : 'Usage'
<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>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> <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>
<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>
<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">site/</div>
<div class="description">Site theme root folder</div>
</div>
</div>
<div class="item">
<i class="folder icon"></i>
<div class="content">
<div class="header">themes</div>
<div class="description">Packaged theme folder</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 class="item">
<i class="folder icon"></i>
<div class="content">
<div class="header">my_theme</div>
<div class="description">custom themes match folder paths</div>
</div>
</div>
</div>
</div>
</div>
<div class="item">
<i class="file icon"></i>
<div class="content">
<a class="header" href="#themeconfig" >theme.config</a>
<div class="description">Config file for setting packaged themes</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div> </div>

1008
server/files/javascript/library/less.js

File diff suppressed because it is too large

12
server/files/javascript/library/less.min.js

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save