├── .gitignore ├── README.md ├── assets ├── js │ ├── angular-front-end-app.js │ ├── controllers │ │ ├── list-controller.js │ │ └── term-controller.js │ └── factories │ │ └── posts-factory.js └── scss │ ├── bootstrap │ ├── _bootstrap-custom.scss │ └── _variables.scss │ └── styles.scss ├── gulpfile.js ├── index.html ├── package.json └── templates ├── list.html ├── pagination.tpl.html └── single.html /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | config.js 3 | build/ 4 | build/* 5 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Decoupled Angular Front End APP ## 2 | This is a decoupled but powered by WordPress Angular app. It is a simple boilerplate to show a list and single view powered by a WordPress website that is located elsewhere. 3 | 4 | ## Installation ## 5 | * Clone/Fork 6 | * Run `npm install` 7 | * Create a config file in `assets/js/config.js` 8 | * Run `gulp` 9 | * Open up `./assets/js/angular-front-end-app.js` 10 | 11 | ## Config File ## 12 | Your `assets/js/config.js` config file should create an object called ngWP with an index called config, with indexes for "api" and "menu" for example: 13 | 14 | ``` 15 | var ngWP = ngWP || {}; 16 | ngWP.config = { 17 | api: 'http://v-jpress.dev/wp-json/', 18 | menu: 'app' 19 | }; 20 | ``` 21 | -------------------------------------------------------------------------------- /assets/js/angular-front-end-app.js: -------------------------------------------------------------------------------- 1 | ngWP.app = angular.module( 'angular-front-end', ['ngResource', 'ui.router', 'LocalStorageModule', 'angularUtils.directives.dirPagination'] ) 2 | .run(function( $rootScope, localStorageService, $http ){ 3 | console.log('app init'); 4 | $rootScope.posts_per_page = ngWP.config.posts_per_page; 5 | 6 | /** Localize Categories **/ 7 | $http.get(ngWP.config.api + 'wp/v2/categories' ).then(function(res){ 8 | var cats = []; 9 | angular.forEach( res.data, function( value, key ) { 10 | cats.push(value); 11 | }); 12 | localStorageService.set( 'cats', cats ); 13 | }); 14 | 15 | /** State Change Logging **/ 16 | $rootScope.$on('$stateChangeStart', function(event, toState, toParams, fromState, fromParams, options){ 17 | //console.log( 'from ',fromState ); 18 | //console.log( 'to ', toState ); 19 | }); 20 | }) 21 | .config( 22 | ['localStorageServiceProvider', 'paginationTemplateProvider', '$stateProvider', '$urlRouterProvider', 23 | function( localStorageServiceProvider, paginationTemplateProvider, $stateProvider,$urlRouterProvider ) { 24 | localStorageServiceProvider.setPrefix('wp'); 25 | paginationTemplateProvider.setPath('./templates/pagination.tpl.html'); 26 | 27 | $urlRouterProvider.otherwise('/'); 28 | $stateProvider 29 | .state('archive',{ 30 | url:'/:post_type', 31 | controller:'listView', 32 | templateUrl: 'templates/list.html' 33 | }) 34 | .state('author',{ 35 | url:'/author/:author', 36 | controller:'authorView', 37 | templateUrl: 'templates/list.html' 38 | }) 39 | .state('category',{ 40 | url:'/category/:term', 41 | controller: 'termView', 42 | templateUrl: 'templates/list.html' 43 | }) 44 | .state('single',{ 45 | url:'/:cpt/:slug', 46 | controller:'singleView', 47 | templateUrl: 'templates/single.html' 48 | }) 49 | }]) 50 | .filter( 'to_trusted', function( $sce ){ 51 | return function( text ){ 52 | return $sce.trustAsHtml( text ); 53 | } 54 | }) 55 | /** 56 | * Single Post View 57 | */ 58 | .controller('singleView', ['$scope', '$http', 'LocalPosts', '$stateParams', 'localStorageService', 59 | function( $scope, $http, LocalPosts, $stateParams, localStorageService ){ 60 | 61 | LocalPosts.getSingle({slug:$stateParams.slug, post_type:$stateParams.cpt}).then(function(res){ 62 | $scope.post = res; 63 | $http.get(ngWP.config.api + 'wp/v2/users/' + $scope.post.author ).then(function(res){ 64 | $scope.author = res.data; 65 | }); 66 | if( $scope.post.categories.length ) { 67 | var cats = localStorageService.get('cats'); 68 | $scope.cats = []; 69 | angular.forEach( cats, function( value, key ) { 70 | if( $scope.post.categories.indexOf( value.id ) > -1 ) { 71 | $scope.cats.push( value ); 72 | } 73 | }); 74 | } 75 | }); 76 | 77 | }]) 78 | .controller('authorView', ['$scope', '$http', '$stateParams', 'Posts', 'LocalPosts', 'localStorageService', 79 | function( $scope, $http, $stateParams, Posts, LocalPosts, localStorageService ){ 80 | console.log( 'loading author ' + $stateParams.author ); 81 | 82 | $scope.posts = []; 83 | $scope.next_page = 2; 84 | $http.get( ngWP.config.api + 'wp/v2/posts/?filter[posts_per_page]=' + ngWP.config.posts_per_page*3 + '&filter[post_author]=' + $stateParams.author ).then(function(res){ 85 | $scope.total_posts = res.headers(); 86 | $scope.total_posts = $scope.total_posts['x-wp-total'] 87 | $scope.posts = res.data; 88 | $scope.pagination = { 89 | current: 1 90 | }; 91 | }); 92 | 93 | /** 94 | * Page Change 95 | * Find total pages, if on last page, query next page 96 | * Next page query is next 3 pages 97 | * @param newPage 98 | */ 99 | $scope.pageChanged = function( newPage ) { 100 | /** 101 | * How many pages based on current amount of posts 102 | * @type {number} 103 | */ 104 | $scope.total_current_pages = $scope.posts.length / ngWP.config.posts_per_page; 105 | /** 106 | * How many total available pages 107 | * @type {number} 108 | */ 109 | $scope.total_available_pages = $scope.total_posts / ngWP.config.posts_per_page; 110 | 111 | if (newPage == $scope.total_current_pages && $scope.total_current_pages < $scope.total_available_pages ) { 112 | $http.get(ngWP.config.api + 'wp/v2/posts/?page=' + $scope.next_page + '&filter[posts_per_page]=' + ngWP.config.posts_per_page*3 + '&filter[post_author]=' + $stateParams.author ) 113 | .then(function(new_posts){ 114 | angular.forEach(new_posts.data, function (value, key) { 115 | $scope.posts.push(value); 116 | }); 117 | }); 118 | $scope.next_page++; 119 | }; 120 | }; 121 | }]) 122 | .controller('header', ['$scope', '$http', function ($scope, $http ) { 123 | 124 | $http({ 125 | url: ngWP.config.api 126 | } ).success( function( res ){ 127 | $scope.site = {}; 128 | $scope.site.name = res.name; 129 | $scope.site.desc = res.description; 130 | }); 131 | 132 | }]) 133 | ; 134 | -------------------------------------------------------------------------------- /assets/js/controllers/list-controller.js: -------------------------------------------------------------------------------- 1 | /** 2 | * List Posts View 3 | */ 4 | ngWP.app.controller('listView', ['$scope', '$http', '$stateParams', 'LocalPosts', 'localStorageService', function( $scope, $http, $stateParams, LocalPosts, localStorageService ){ 5 | /** 6 | * Set a controller wide CPT 7 | * @type {string} 8 | */ 9 | 10 | $scope.posts = []; 11 | $scope.next_page = 2; 12 | $scope.posts = LocalPosts.query({per_page: [ngWP.config.posts_per_page * 3], post_type: $stateParams.post_type}).then(function(res){ 13 | $scope.total_posts = res.total_posts; 14 | $scope.posts = res.posts; 15 | $scope.pagination = { 16 | current: 1 17 | }; 18 | }); 19 | 20 | /** 21 | * Page Change 22 | * Find total pages, if on last page, query next page 23 | * Next page query is next 3 pages 24 | * @param newPage 25 | */ 26 | $scope.pageChanged = function( newPage ) { 27 | /** 28 | * How many pages based on current amount of posts 29 | * @type {number} 30 | */ 31 | $scope.total_current_pages = $scope.posts.length / ngWP.config.posts_per_page; 32 | /** 33 | * How many total available pages 34 | * @type {number} 35 | */ 36 | $scope.total_available_pages = $scope.total_posts / ngWP.config.posts_per_page; 37 | 38 | if (newPage == $scope.total_current_pages && $scope.total_current_pages < $scope.total_available_pages ) { 39 | LocalPosts.getPage({page: $scope.next_page, per_page: ngWP.config.posts_per_page * 3}).then(function (new_posts) { 40 | angular.forEach(new_posts, function (value, key) { 41 | $scope.posts.push(value); 42 | }); 43 | }); 44 | $scope.next_page++; 45 | }; 46 | }; 47 | }]) -------------------------------------------------------------------------------- /assets/js/controllers/term-controller.js: -------------------------------------------------------------------------------- 1 | ngWP.app.controller('termView', ['$scope', '$http', 'LocalPosts', 'localStorageService', '$stateParams', 2 | function( $scope, $http, LocalPosts, localStorageService, $stateParams ) { 3 | 4 | $scope.posts = []; 5 | $scope.next_page = 2; 6 | var cats = localStorageService.get('cats'); 7 | $scope.term = {}; 8 | 9 | angular.forEach( cats, function( value, key ) { 10 | if( value.slug == $stateParams.term ) { 11 | $scope.term = value; 12 | } 13 | }); 14 | LocalPosts.query({per_page: [ngWP.config.posts_per_page * 3], categories: $scope.term.id}).then(function(res){ 15 | $scope.total_posts = res.total_posts; 16 | $scope.posts = res.posts; 17 | $scope.pagination = { 18 | current: 1 19 | }; 20 | }); 21 | 22 | /** 23 | * Page Change 24 | * Find total pages, if on last page, query next page 25 | * Next page query is next 3 pages 26 | * @param newPage 27 | */ 28 | $scope.pageChanged = function( newPage ) { 29 | /** 30 | * How many pages based on current amount of posts 31 | * @type {number} 32 | */ 33 | $scope.total_current_pages = $scope.posts.length / ngWP.config.posts_per_page; 34 | /** 35 | * How many total available pages 36 | * @type {number} 37 | */ 38 | $scope.total_available_pages = Math.ceil( $scope.total_posts / ngWP.config.posts_per_page ); 39 | 40 | if (newPage == $scope.total_current_pages && $scope.total_current_pages < $scope.total_available_pages ) { 41 | LocalPosts.getPage({page: $scope.next_page, per_page: ngWP.config.posts_per_page * 3, post_type: $scope.post_type, categories: $scope.term.id}).then(function (new_posts) { 42 | angular.forEach(new_posts.posts, function (value, key) { 43 | $scope.posts.push(value); 44 | }); 45 | }); 46 | $scope.next_page++; 47 | }; 48 | }; 49 | }]); -------------------------------------------------------------------------------- /assets/js/factories/posts-factory.js: -------------------------------------------------------------------------------- 1 | ngWP.app 2 | .factory('Posts',function($resource){ 3 | return $resource( ngWP.config.api + 'wp/v2/:post_type/:ID?filter[posts_per_page]=:per_page&filter[post_author]=:author', { 4 | /** 5 | * without @ is default value 6 | */ 7 | post_type: 'posts', 8 | ID:'@id', 9 | per_page: ngWP.config.posts_per_page, 10 | author: '@author' 11 | }); 12 | }) 13 | .factory( 'LocalPosts', function( $http, $resource, localStorageService, Posts, $q ) { 14 | localPostObj = { 15 | query: function( data ) { 16 | var deferred = $q.defer(); 17 | var more_data = {}, 18 | posts_res = {}; 19 | if( !data.post_type ) { 20 | data.post_type = 'posts'; 21 | } 22 | 23 | /** 24 | * If category 25 | */ 26 | if( data.categories ) { 27 | var url = ngWP.config.api + 'wp/v2/' + data.post_type + '?filter[posts_per_page]=' + ngWP.config.posts_per_page * 3 + '&categories=' + data.categories; 28 | $http.get( url ).success(function(posts_res, status, headers ) { 29 | var more_data = headers(); 30 | deferred.resolve({ 31 | posts: posts_res, 32 | total_posts: more_data['x-wp-total'] 33 | }); 34 | }); 35 | return deferred.promise; 36 | } 37 | console.log( 'not category' ); 38 | 39 | Posts.query(data, function(res, status, headers, config){ 40 | var posts_res = res, 41 | more_data = status(); 42 | 43 | /** 44 | * Check localStorage first 45 | */ 46 | if( 47 | localStorageService.get('posts[' + data.post_type + ']') && 48 | localStorageService.get('posts[' + data.post_type + ']').length > 0 49 | ) { 50 | deferred.resolve({ 51 | posts: localStorageService.get('posts[' + data.post_type + ']'), 52 | total_posts: more_data['x-wp-total'] 53 | }); 54 | } else { 55 | localStorageService.set( 'posts[' + data.post_type + ']', posts_res ); 56 | deferred.resolve({ 57 | posts: posts_res, 58 | total_posts: more_data['x-wp-total'] 59 | }); 60 | } 61 | }); 62 | return deferred.promise; 63 | }, 64 | /** 65 | * Get a specific page number based on per_page 66 | * @param data 67 | * @returns {*} 68 | */ 69 | getPage: function( data ) { 70 | if( !data || !data.page ) { 71 | return false; 72 | } 73 | if( !data.post_type ) { 74 | data.post_type = 'posts'; 75 | } 76 | var deferred = $q.defer(); 77 | Posts.query(data, function(res){ 78 | 79 | /** 80 | * If category 81 | */ 82 | if( data.categories ) { 83 | deferred.resolve({ 84 | posts: res, 85 | }); 86 | return deferred.promise; 87 | } 88 | 89 | var current_posts = localStorageService.get('posts[' + data.post_type + ']'); 90 | angular.forEach( res, function( value, key ) { 91 | current_posts.push( value ); 92 | }); 93 | localStorageService.set('posts[' + data.post_type + ']', current_posts ); 94 | deferred.resolve( res ); 95 | }); 96 | return deferred.promise; 97 | }, 98 | /** 99 | * Get Single Post (any post type) 100 | * @param data 101 | * @returns {*} 102 | */ 103 | getSingle: function( data ) { 104 | if( !data || !data.slug || !data.post_type ) { 105 | return false; 106 | } 107 | if( data.post_type == 'post' ) { 108 | data.post_type = 'posts'; 109 | } 110 | var deferred = $q.defer(); 111 | var current_posts = localStorageService.get( 'posts[' + data.post_type + ']' ); 112 | var found_post = false; 113 | data.per_page = 1; 114 | for( var i = 0; i < current_posts.length; i++ ) { 115 | if( current_posts[i].slug == data.slug ) { 116 | found_post = true; 117 | deferred.resolve( current_posts[i] ); 118 | break; 119 | } 120 | }; 121 | if( !found_post ) { 122 | this.refreshLocal( data ); 123 | current_posts = localStorageService.get( 'posts[' + data.post_type + ']' ); 124 | for( var i = 0; i < current_posts.length; i++ ) { 125 | if( current_posts[i].slug == data.slug ) { 126 | found_post = true; 127 | deferred.resolve( current_posts[i] ); 128 | break; 129 | } 130 | }; 131 | } 132 | return deferred.promise; 133 | }, 134 | refreshLocal: function( data ) { 135 | if( !data || !data.post_type ) { 136 | return false; 137 | } 138 | data.per_page = ngWP.config.posts_per_page * 3; 139 | var deferred = $q.defer(); 140 | Posts.query(data, function(res, status, headers, config){ 141 | localStorageService.set('posts[' + data.post_type + ']', res ); 142 | }); 143 | } 144 | }; 145 | 146 | return localPostObj; 147 | }) -------------------------------------------------------------------------------- /assets/scss/bootstrap/_bootstrap-custom.scss: -------------------------------------------------------------------------------- 1 | // Core variables and mixins 2 | @import "variables"; 3 | @import "../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/mixins"; 4 | 5 | // Reset and dependencies 6 | @import "../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/normalize"; 7 | @import "../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/print"; 8 | @import "../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/glyphicons"; 9 | 10 | // Core CSS 11 | @import "../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/scaffolding"; 12 | @import "../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/type"; 13 | @import "../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/code"; 14 | @import "../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/grid"; 15 | @import "../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/tables"; 16 | @import "../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/forms"; 17 | @import "../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/buttons"; 18 | 19 | // Components 20 | @import "../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/component-animations"; 21 | @import "../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/dropdowns"; 22 | @import "../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/button-groups"; 23 | @import "../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/input-groups"; 24 | @import "../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/navs"; 25 | @import "../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/navbar"; 26 | @import "../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/breadcrumbs"; 27 | @import "../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/pagination"; 28 | @import "../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/pager"; 29 | @import "../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/labels"; 30 | @import "../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/badges"; 31 | @import "../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/jumbotron"; 32 | @import "../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/thumbnails"; 33 | @import "../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/alerts"; 34 | @import "../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/progress-bars"; 35 | @import "../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/media"; 36 | @import "../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/list-group"; 37 | @import "../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/panels"; 38 | @import "../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/responsive-embed"; 39 | @import "../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/wells"; 40 | @import "../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/close"; 41 | 42 | // Components w/ JavaScript 43 | @import "../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/modals"; 44 | @import "../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/tooltip"; 45 | @import "../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/popovers"; 46 | @import "../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/carousel"; 47 | 48 | // Utility classes 49 | @import "../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/utilities"; 50 | @import "../../../node_modules/bootstrap-sass/assets/stylesheets/bootstrap/responsive-utilities"; 51 | -------------------------------------------------------------------------------- /assets/scss/bootstrap/_variables.scss: -------------------------------------------------------------------------------- 1 | $bootstrap-sass-asset-helper: false !default; 2 | // 3 | // Variables 4 | // -------------------------------------------------- 5 | 6 | 7 | //== Colors 8 | // 9 | //## Gray and brand colors for use across Bootstrap. 10 | 11 | $gray-base: #000 !default; 12 | $gray-darker: lighten($gray-base, 13.5%) !default; // #222 13 | $gray-dark: lighten($gray-base, 20%) !default; // #333 14 | $gray: lighten($gray-base, 33.5%) !default; // #555 15 | $gray-light: lighten($gray-base, 46.7%) !default; // #777 16 | $gray-lighter: lighten($gray-base, 93.5%) !default; // #eee 17 | 18 | $brand-primary: darken(#428bca, 6.5%) !default; // #337ab7 19 | $brand-success: #5cb85c !default; 20 | $brand-info: #5bc0de !default; 21 | $brand-warning: #f0ad4e !default; 22 | $brand-danger: #d9534f !default; 23 | 24 | 25 | //== Scaffolding 26 | // 27 | //## Settings for some of the most global styles. 28 | 29 | //** Background color for `
`. 30 | $body-bg: #fff !default; 31 | //** Global text color on ``. 32 | $text-color: $gray-dark !default; 33 | 34 | //** Global textual link color. 35 | $link-color: $brand-primary !default; 36 | //** Link hover color set via `darken()` function. 37 | $link-hover-color: darken($link-color, 15%) !default; 38 | //** Link hover decoration. 39 | $link-hover-decoration: underline !default; 40 | 41 | 42 | //== Typography 43 | // 44 | //## Font, line-height, and color for body text, headings, and more. 45 | 46 | $font-family-sans-serif: "Helvetica Neue", Helvetica, Arial, sans-serif !default; 47 | $font-family-serif: Georgia, "Times New Roman", Times, serif !default; 48 | //** Default monospace fonts for ``, ``, and ``.
49 | $font-family-monospace: Menlo, Monaco, Consolas, "Courier New", monospace !default;
50 | $font-family-base: $font-family-sans-serif !default;
51 |
52 | $font-size-base: 14px !default;
53 | $font-size-large: ceil(($font-size-base * 1.25)) !default; // ~18px
54 | $font-size-small: ceil(($font-size-base * 0.85)) !default; // ~12px
55 |
56 | $font-size-h1: floor(($font-size-base * 2.6)) !default; // ~36px
57 | $font-size-h2: floor(($font-size-base * 2.15)) !default; // ~30px
58 | $font-size-h3: ceil(($font-size-base * 1.7)) !default; // ~24px
59 | $font-size-h4: ceil(($font-size-base * 1.25)) !default; // ~18px
60 | $font-size-h5: $font-size-base !default;
61 | $font-size-h6: ceil(($font-size-base * 0.85)) !default; // ~12px
62 |
63 | //** Unit-less `line-height` for use in components like buttons.
64 | $line-height-base: 1.428571429 !default; // 20/14
65 | //** Computed "line-height" (`font-size` * `line-height`) for use with `margin`, `padding`, etc.
66 | $line-height-computed: floor(($font-size-base * $line-height-base)) !default; // ~20px
67 |
68 | //** By default, this inherits from the ``.
69 | $headings-font-family: inherit !default;
70 | $headings-font-weight: 500 !default;
71 | $headings-line-height: 1.1 !default;
72 | $headings-color: inherit !default;
73 |
74 |
75 | //== Iconography
76 | //
77 | //## Specify custom location and filename of the included Glyphicons icon font. Useful for those including Bootstrap via Bower.
78 |
79 | //** Load fonts from this directory.
80 |
81 | // [converter] If $bootstrap-sass-asset-helper if used, provide path relative to the assets load path.
82 | // [converter] This is because some asset helpers, such as Sprockets, do not work with file-relative paths.
83 | $icon-font-path: if($bootstrap-sass-asset-helper, "bootstrap/", "../fonts/bootstrap/") !default;
84 |
85 | //** File name for all font files.
86 | $icon-font-name: "glyphicons-halflings-regular" !default;
87 | //** Element ID within SVG icon file.
88 | $icon-font-svg-id: "glyphicons_halflingsregular" !default;
89 |
90 |
91 | //== Components
92 | //
93 | //## Define common padding and border radius sizes and more. Values based on 14px text and 1.428 line-height (~20px to start).
94 |
95 | $padding-base-vertical: 6px !default;
96 | $padding-base-horizontal: 12px !default;
97 |
98 | $padding-large-vertical: 10px !default;
99 | $padding-large-horizontal: 16px !default;
100 |
101 | $padding-small-vertical: 5px !default;
102 | $padding-small-horizontal: 10px !default;
103 |
104 | $padding-xs-vertical: 1px !default;
105 | $padding-xs-horizontal: 5px !default;
106 |
107 | $line-height-large: 1.3333333 !default; // extra decimals for Win 8.1 Chrome
108 | $line-height-small: 1.5 !default;
109 |
110 | $border-radius-base: 4px !default;
111 | $border-radius-large: 6px !default;
112 | $border-radius-small: 3px !default;
113 |
114 | //** Global color for active items (e.g., navs or dropdowns).
115 | $component-active-color: #fff !default;
116 | //** Global background color for active items (e.g., navs or dropdowns).
117 | $component-active-bg: $brand-primary !default;
118 |
119 | //** Width of the `border` for generating carets that indicator dropdowns.
120 | $caret-width-base: 4px !default;
121 | //** Carets increase slightly in size for larger components.
122 | $caret-width-large: 5px !default;
123 |
124 |
125 | //== Tables
126 | //
127 | //## Customizes the `.table` component with basic values, each used across all table variations.
128 |
129 | //** Padding for ``s and ` `s.
130 | $table-cell-padding: 8px !default;
131 | //** Padding for cells in `.table-condensed`.
132 | $table-condensed-cell-padding: 5px !default;
133 |
134 | //** Default background color used for all tables.
135 | $table-bg: transparent !default;
136 | //** Background color used for `.table-striped`.
137 | $table-bg-accent: #f9f9f9 !default;
138 | //** Background color used for `.table-hover`.
139 | $table-bg-hover: #f5f5f5 !default;
140 | $table-bg-active: $table-bg-hover !default;
141 |
142 | //** Border color for table and cell borders.
143 | $table-border-color: #ddd !default;
144 |
145 |
146 | //== Buttons
147 | //
148 | //## For each of Bootstrap's buttons, define text, background and border color.
149 |
150 | $btn-font-weight: normal !default;
151 |
152 | $btn-default-color: #333 !default;
153 | $btn-default-bg: #fff !default;
154 | $btn-default-border: #ccc !default;
155 |
156 | $btn-primary-color: #fff !default;
157 | $btn-primary-bg: $brand-primary !default;
158 | $btn-primary-border: darken($btn-primary-bg, 5%) !default;
159 |
160 | $btn-success-color: #fff !default;
161 | $btn-success-bg: $brand-success !default;
162 | $btn-success-border: darken($btn-success-bg, 5%) !default;
163 |
164 | $btn-info-color: #fff !default;
165 | $btn-info-bg: $brand-info !default;
166 | $btn-info-border: darken($btn-info-bg, 5%) !default;
167 |
168 | $btn-warning-color: #fff !default;
169 | $btn-warning-bg: $brand-warning !default;
170 | $btn-warning-border: darken($btn-warning-bg, 5%) !default;
171 |
172 | $btn-danger-color: #fff !default;
173 | $btn-danger-bg: $brand-danger !default;
174 | $btn-danger-border: darken($btn-danger-bg, 5%) !default;
175 |
176 | $btn-link-disabled-color: $gray-light !default;
177 |
178 | // Allows for customizing button radius independently from global border radius
179 | $btn-border-radius-base: $border-radius-base !default;
180 | $btn-border-radius-large: $border-radius-large !default;
181 | $btn-border-radius-small: $border-radius-small !default;
182 |
183 |
184 | //== Forms
185 | //
186 | //##
187 |
188 | //** `` background color
189 | $input-bg: #fff !default;
190 | //** `` background color
191 | $input-bg-disabled: $gray-lighter !default;
192 |
193 | //** Text color for ``s
194 | $input-color: $gray !default;
195 | //** `` border color
196 | $input-border: #ccc !default;
197 |
198 | // TODO: Rename `$input-border-radius` to `$input-border-radius-base` in v4
199 | //** Default `.form-control` border radius
200 | // This has no effect on `