webdesign:html5
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
webdesign:html5 [2015/05/17 00:43] – [Create custom style for bootstrap with less] admin | webdesign:html5 [2016/01/14 04:29] (current) – removed admin | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== HTML5 ====== | ||
- | ===== Understand about HTML5 ===== | ||
- | ==== HTML5 Browser Support ==== | ||
- | refer: | ||
- | * http:// | ||
- | HTML5 browser support: | ||
- | * HTML5 is **supported in all modern browsers**. | ||
- | * In addition, all browsers, **old and new, automatically handle unrecognized elements as inline elements**. Because of this, you can **" | ||
- | ===== Javascript tools ===== | ||
- | |||
- | ==== npm(package manager for javascript...) ==== | ||
- | refer: https:// | ||
- | ==== bower(package manager for the web) ==== | ||
- | refer: http:// | ||
- | Web sites are made of lots of things — **frameworks, | ||
- | * Install bower< | ||
- | npm install -g bower | ||
- | </ | ||
- | * Using bower to search all libraries which contain the word **" | ||
- | bower search jquery | ||
- | </ | ||
- | ............................... | ||
- | jquery-autogrow-textarea git:// | ||
- | jquery-formchecker git:// | ||
- | inview-jquery-plugin git:// | ||
- | good-form git:// | ||
- | jquery-fivehundredpx git:// | ||
- | ............................... | ||
- | </ | ||
- | * Create bower.json from **bower_components** in project< | ||
- | bower init | ||
- | </ | ||
- | * Install all packages which were configured in bower.json to **bower_components**< | ||
- | bower install | ||
- | </ | ||
- | * Install single package to your project(You must **install git** before run **bower install**):< | ||
- | bower install < | ||
- | </ | ||
- | bower install good-form | ||
- | </ | ||
- | ==== Grunt(Javascript Task Runner) ==== | ||
- | refer: http:// | ||
- | ==== Node.js ==== | ||
- | refer: https:// | ||
- | Node.js® is a platform built on **Chrome' | ||
- | ==== Dust ==== | ||
- | refer: http:// | ||
- | ===== CSS tools ===== | ||
- | ==== Sass(CSS pre-processor which wroten with Ruby Language) ==== | ||
- | refer: | ||
- | * http:// | ||
- | * http:// | ||
- | Sass is an extension of CSS that adds power and elegance to the basic language. It allows you to use **variables, | ||
- | ==== Less(CSS pre-processor which wroten with Javascript Language) ==== | ||
- | refer: | ||
- | * http:// | ||
- | * less editor: http:// | ||
- | Less is a **CSS pre-processor**, | ||
- | |||
- | Less(less.js) **runs inside Node**, in the browser and **inside Rhino**. There are also many 3rd party tools that allow you to compile your files and watch for changes. | ||
- | |||
- | Install less:< | ||
- | npm install -g less | ||
- | </ | ||
- | Compile less file to css:< | ||
- | lessc styles.less > styles.css | ||
- | </ | ||
- | Basic about less language: | ||
- | * Variables: less content< | ||
- | @nice-blue: #5B83AD; | ||
- | @light-blue: | ||
- | |||
- | #header { | ||
- | color: @light-blue; | ||
- | } | ||
- | </ | ||
- | #header { | ||
- | color: #6c94be; | ||
- | } | ||
- | </ | ||
- | * Mixins: | ||
- | .bordered { | ||
- | border-top: dotted 1px black; | ||
- | border-bottom: | ||
- | }And we want to **use these properties inside other rule-sets**. Well, we just have to drop in the name of the class where we want the properties, like so:<code css> | ||
- | #menu a { | ||
- | color: #111; | ||
- | .bordered; | ||
- | } | ||
- | |||
- | .post a { | ||
- | color: red; | ||
- | .bordered; | ||
- | } | ||
- | </ | ||
- | * Nested rules: Less gives you the ability to use **nesting** instead of, or **in combination with cascading**. Let's say we have the following **CSS**:< | ||
- | #header { | ||
- | color: black; | ||
- | } | ||
- | #header .navigation { | ||
- | font-size: 12px; | ||
- | } | ||
- | #header .logo { | ||
- | width: 300px; | ||
- | } | ||
- | </ | ||
- | #header { | ||
- | color: black; | ||
- | .navigation { | ||
- | font-size: 12px; | ||
- | } | ||
- | .logo { | ||
- | width: 300px; | ||
- | } | ||
- | } | ||
- | </ | ||
- | .clearfix { | ||
- | display: block; | ||
- | zoom: 1; | ||
- | |||
- | &:after { | ||
- | content: " "; | ||
- | display: block; | ||
- | font-size: 0; | ||
- | height: 0; | ||
- | clear: both; | ||
- | visibility: hidden; | ||
- | } | ||
- | } | ||
- | </ | ||
- | ==== Compat Framework ==== | ||
- | refer: http:// | ||
- | ==== css to less ==== | ||
- | refer: | ||
- | * http:// | ||
- | * https:// | ||
- | * https:// | ||
- | * https:// | ||
- | ===== Bootstrap ===== | ||
- | refer: | ||
- | * http:// | ||
- | * http:// | ||
- | * http:// | ||
- | * http:// | ||
- | Bootstrap is the most popular **HTML, CSS, and JS framework** for developing responsive, mobile first projects on the web | ||
- | ==== Build bootstrap from source with gruntjs ==== | ||
- | === Install some basic tool before build === | ||
- | - Step1: Install **npm** tool by **install nodejs** to d: | ||
- | - Step2: Install **grunt**(Package Manager for Javascript):< | ||
- | npm install -g grunt-cli | ||
- | </ | ||
- | === Build Bootstrap === | ||
- | - Step1: Navigate to the **root /bootstrap/ directory**, | ||
- | npm install | ||
- | </ | ||
- | - Step2: Regenerates the /dist/ directory with compiled and minified CSS and JavaScript files< | ||
- | grunt dist | ||
- | </ | ||
- | ==== Create custom style ==== | ||
- | You can create a **custom navbar class**(navbar-custom), | ||
- | <code html> | ||
- | <nav class=" | ||
- | <div class=" | ||
- | <button type=" | ||
- | </ | ||
- | <a class=" | ||
- | </ | ||
- | ... | ||
- | </ | ||
- | </ | ||
- | CSS | ||
- | <code css> | ||
- | .navbar-custom { | ||
- | background-color:# | ||
- | color:# | ||
- | border-radius: | ||
- | } | ||
- | |||
- | .navbar-custom .navbar-nav > li > a { | ||
- | color:#fff; | ||
- | } | ||
- | .navbar-custom .navbar-nav > .active > a, .navbar-nav > .active > a:hover, .navbar-nav > .active > a:focus { | ||
- | color: #ffffff; | ||
- | background-color: | ||
- | } | ||
- | .navbar-custom .navbar-brand { | ||
- | color:# | ||
- | } | ||
- | </ | ||
- | |||
- | ==== Create custom style for bootstrap with less ==== | ||
- | === Advantages of this method === | ||
- | Using Less, especially with Bootstrap 3, gives you a few advantages that really make it a awesome choice | ||
- | |||
- | Advantages of less language: | ||
- | * Changing variables in one place can have wide-reaching effects, for super easy global customization | ||
- | * Augment, shift, and change existing styles and variables, or roll your own | ||
- | * Componentization. You can break your Less up into smaller files for very easy editing and separation, great for applications where you’re using version control like GitHub | ||
- | Advantages of importing bootstrap.less: | ||
- | * Have a clean, customized singular CSS file | ||
- | * You can easily comment out any part of Bootstrap you don’t need or want, right down to the single line | ||
- | * Easily override Bootstrap variables/ | ||
- | * We can easily **reused the variables and mixins** of bootstrap in new styles | ||
- | === Steps by steps === | ||
- | We **create the new less file** and using **less tool** to rebuild new less file | ||
- | - Step1: Create **style.less** which import **bootstrap** and other changes in **nav.less, header.less, | ||
- | @import " | ||
- | @import " | ||
- | |||
- | @import " | ||
- | @import " | ||
- | @import " | ||
- | @import " | ||
- | @import " | ||
- | </ | ||
- | - Step2: create files **variables.less, | ||
- | - Step3: Using less tool to compile style.css< | ||
- | lessc style.less > style.css | ||
- | </ | ||
- | ==== Themes for bootstrap ==== | ||
- | refer: | ||
- | * http:// | ||
- | * http:// | ||
- | * http:// | ||
- | * https:// | ||
- | * http:// | ||
- | * http:// | ||
- | * http:// | ||
- | ==== Build less file in bootswatch ==== | ||
- | Create below script to build all less file in bootswatch(Base on https:// | ||
- | #!/bin/sh | ||
- | |||
- | set -e | ||
- | |||
- | cd bootstrap_themes/ | ||
- | for theme in *; do | ||
- | if [ -d " | ||
- | mkdir -p " | ||
- | lessc " | ||
- | recess --compress " | ||
- | fi | ||
- | done | ||
- | </ | ||
- | ===== Javascript Resources which support for designer ===== | ||
- | ==== Respond.js ==== | ||
- | Respond.js: https:// | ||
- | ==== Modernizr ==== | ||
- | Modernizr – http:// | ||
- | ===== UI Kits ===== | ||
- | ==== Flat UI ==== | ||
- | refer: | ||
- | * http:// | ||
- | * https:// | ||
- | |||
- | |||
- | ==== Boot Flat ==== | ||
- | refer: | ||
- | * http:// | ||
- | * https:// |
webdesign/html5.1431823439.txt.gz · Last modified: 2022/10/29 16:15 (external edit)