.
8 | .list-group {
9 | // No need to set list-style: none; since .list-group-item is block level
10 | margin-bottom: 20px;
11 | padding-left: 0; // reset padding because ul and ol
12 | }
13 |
14 | // Individual list items
15 | // -------------------------
16 |
17 | .list-group-item {
18 | position: relative;
19 | display: block;
20 | padding: 10px 15px;
21 | // Place the border on the list items and negative margin up for better styling
22 | margin-bottom: -1px;
23 | background-color: @list-group-bg;
24 | border: 1px solid @list-group-border;
25 |
26 | // Round the first and last items
27 | &:first-child {
28 | .border-top-radius(@list-group-border-radius);
29 | }
30 | &:last-child {
31 | margin-bottom: 0;
32 | .border-bottom-radius(@list-group-border-radius);
33 | }
34 |
35 | // Align badges within list items
36 | > .badge {
37 | float: right;
38 | }
39 | > .badge + .badge {
40 | margin-right: 5px;
41 | }
42 | }
43 |
44 | // Linked list items
45 | a.list-group-item {
46 | color: @list-group-link-color;
47 |
48 | .list-group-item-heading {
49 | color: @list-group-link-heading-color;
50 | }
51 |
52 | // Hover state
53 | &:hover,
54 | &:focus {
55 | text-decoration: none;
56 | background-color: @list-group-hover-bg;
57 | }
58 |
59 | // Active class on item itself, not parent
60 | &.active,
61 | &.active:hover,
62 | &.active:focus {
63 | z-index: 2; // Place active items above their siblings for proper border styling
64 | color: @list-group-active-color;
65 | background-color: @list-group-active-bg;
66 | border-color: @list-group-active-border;
67 |
68 | // Force color to inherit for custom content
69 | .list-group-item-heading {
70 | color: inherit;
71 | }
72 | .list-group-item-text {
73 | color: lighten(@list-group-active-bg, 40%);
74 | }
75 | }
76 | }
77 |
78 | // Custom content options
79 | // -------------------------
80 |
81 | .list-group-item-heading {
82 | margin-top: 0;
83 | margin-bottom: 5px;
84 | }
85 | .list-group-item-text {
86 | margin-bottom: 0;
87 | line-height: 1.3;
88 | }
89 |
--------------------------------------------------------------------------------
/data/team.yml:
--------------------------------------------------------------------------------
1 | # =============================================
2 | # Team: Alphabetical Order
3 | # =============================================
4 |
5 | members:
6 | - name: Alexis Sellier
7 | username: cloudhead
8 | contribution: "Original Author, Language Design"
9 | follow: "https://ghbtns.com/github-btn.html?user=cloudhead&type=follow"
10 | gravatar: "https://www.gravatar.com/avatar/a8a0061962c41735ca87789720da46c8"
11 |
12 | - name: Luke Page
13 | username: lukeapage
14 | contribution: "Releasing, Development, Language Design, Documentation"
15 | follow: "https://ghbtns.com/github-btn.html?user=lukeapage&type=follow"
16 | gravatar: "https://www.gravatar.com/avatar/a80ab1a8297225d70baffc52adf6aefd"
17 |
18 | - name: Marcus Bointon
19 | username: Synchro
20 | contribution: "Color Functions"
21 | follow: "https://ghbtns.com/github-btn.html?user=synchro&type=follow"
22 | gravatar: "https://www.gravatar.com/avatar/b4814d6790e91f01c77cac9d25db12b6"
23 |
24 | - name: Mária Jurčovičová
25 | username: sommeri
26 | contribution: "Language Design, Java Port"
27 | follow: "https://ghbtns.com/github-btn.html?user=sommeri&type=follow"
28 | gravatar: "https://www.gravatar.com/avatar/52cf28b41537a1255243f6ba9b5baedc"
29 |
30 | - name: Matthew Dean
31 | username: matthew-dean
32 | contribution: "Project Management, Releasing, Development, Language Design, Community"
33 | follow: "https://ghbtns.com/github-btn.html?user=matthew-dean&type=follow"
34 | gravatar: "https://www.gravatar.com/avatar/09caa4a26a5e57031146b5e06b4d7a8c"
35 |
36 | - name: Max Mikhailov
37 | username: seven-phases-max
38 | contribution: "Development, Documentation, Language Design"
39 | follow: "https://ghbtns.com/github-btn.html?user=seven-phases-max&type=follow"
40 | gravatar: "https://www.gravatar.com/avatar/f7c830e90f5d6a740ab908365dcd3849"
41 |
42 | - name: Lei Chen
43 | username: iChenLei
44 | contribution: "Development, Documentation, Language Design, Community"
45 | follow: "https://ghbtns.com/github-btn.html?user=iChenLei&type=follow"
46 | gravatar: "https://avatars.githubusercontent.com/u/14012511?v=4&s=50"
47 |
--------------------------------------------------------------------------------
/content/usage/programmatic-usage.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Programmatic usage
3 | ---
4 |
5 | The main entry point into `less` is the `less.render` function. This takes the following format
6 |
7 | ```js
8 | less.render(lessInput, options)
9 | .then(function(output) {
10 | // output.css = string of css
11 | // output.map = string of sourcemap
12 | // output.imports = array of string filenames of the imports referenced
13 | },
14 | function(error) {
15 | });
16 |
17 | // or...
18 |
19 | less.render(css, options, function(error, output) {})
20 | ```
21 |
22 | The options argument is optional. If you specify a callback then a promise will not be returned, where as if you do not specify a callback a promise will be given.
23 | Under the hood, the callback version is used so that less can be used synchronously.
24 |
25 | If you wanted to render a file, you would first read it into a string (to pass to less.render) and then set the filename field on options to be the filename of the main file. less will handle all the processing of the imports.
26 |
27 | The `sourceMap` option is an object which enables you to set sub sourcemap options. Available sub options are: `sourceMapURL`,`sourceMapBasepath`,`sourceMapRootpath`,`outputSourceFiles` and `sourceMapFileInline`. Notice that the `sourceMap` option is not available for the less.js in browser compiler now.
28 |
29 | ```js
30 | less.render(lessInput)
31 | .then(function(output) {
32 | // output.css = string of css
33 | // output.map = undefined
34 | }
35 | //,
36 | less.render(lessInput, {sourceMap: {}})
37 | .then(function(output) {
38 | // output.css = string of css
39 | // output.map = string of sourcemap
40 | }
41 | //or,
42 | less.render(lessInput, {sourceMap: {sourceMapFileInline: true}})
43 | .then(function(output) {
44 | // output.css = string of css \n /*# sourceMappingURL=data:application/json;base64,eyJ2ZXJ..= */
45 | // output.map = undefined
46 | }
47 | ```
48 |
49 | ### Getting Access to the Log
50 |
51 | You can add a log listener with the following code
52 |
53 | ```js
54 | less.logger.addListener({
55 | debug: function(msg) {
56 | },
57 | info: function(msg) {
58 | },
59 | warn: function(msg) {
60 | },
61 | error: function(msg) {
62 | }
63 | });
64 | ```
65 |
66 | Note: all functions are optional. An error will not be logged, but instead is passed back to the callback or promise in less.render
67 |
--------------------------------------------------------------------------------
/styles/bootstrap/scaffolding.less:
--------------------------------------------------------------------------------
1 | //
2 | // Scaffolding
3 | // --------------------------------------------------
4 |
5 |
6 | // Reset the box-sizing
7 |
8 | *,
9 | *:before,
10 | *:after {
11 | .box-sizing(border-box);
12 | }
13 |
14 |
15 | // Body reset
16 |
17 | html {
18 | font-size: 62.5%;
19 | -webkit-tap-highlight-color: rgba(0,0,0,0);
20 | }
21 |
22 | body {
23 | font-family: @font-family-base;
24 | font-size: @font-size-base;
25 | line-height: @line-height-base;
26 | color: @text-color;
27 | background-color: @body-bg;
28 | }
29 |
30 | // Reset fonts for relevant elements
31 | input,
32 | button,
33 | select,
34 | textarea {
35 | font-family: inherit;
36 | font-size: inherit;
37 | line-height: inherit;
38 | }
39 |
40 |
41 | // Links
42 |
43 | a {
44 | color: @link-color;
45 | text-decoration: none;
46 |
47 | &:hover,
48 | &:focus {
49 | color: @link-hover-color;
50 | text-decoration: underline;
51 | }
52 |
53 | &:focus {
54 | .tab-focus();
55 | }
56 | }
57 |
58 |
59 | // Images
60 |
61 | img {
62 | vertical-align: middle;
63 | }
64 |
65 | // Responsive images (ensure images don't scale beyond their parents)
66 | .img-responsive {
67 | .img-responsive();
68 | }
69 |
70 | // Rounded corners
71 | .img-rounded {
72 | border-radius: @border-radius-large;
73 | }
74 |
75 | // Image thumbnails
76 | //
77 | // Heads up! This is mixin-ed into thumbnails.less for `.thumbnail`.
78 | .img-thumbnail {
79 | padding: @thumbnail-padding;
80 | line-height: @line-height-base;
81 | background-color: @thumbnail-bg;
82 | border: 1px solid @thumbnail-border;
83 | border-radius: @thumbnail-border-radius;
84 | .transition(all .2s ease-in-out);
85 |
86 | // Keep them at most 100% wide
87 | .img-responsive(inline-block);
88 | }
89 |
90 | // Perfect circle
91 | .img-circle {
92 | border-radius: 50%; // set radius in percents
93 | }
94 |
95 |
96 | // Horizontal rules
97 |
98 | hr {
99 | margin-top: @line-height-computed;
100 | margin-bottom: @line-height-computed;
101 | border: 0;
102 | border-top: 1px solid @hr-border;
103 | }
104 |
105 |
106 | // Only display content to screen readers
107 | //
108 | // See: http://a11yproject.com/posts/how-to-hide-content/
109 |
110 | .sr-only {
111 | position: absolute;
112 | width: 1px;
113 | height: 1px;
114 | margin: -1px;
115 | padding: 0;
116 | overflow: hidden;
117 | clip: rect(0,0,0,0);
118 | border: 0;
119 | }
120 |
--------------------------------------------------------------------------------
/styles/bootstrap/progress-bars.less:
--------------------------------------------------------------------------------
1 | //
2 | // Progress bars
3 | // --------------------------------------------------
4 |
5 |
6 | // Bar animations
7 | // -------------------------
8 |
9 | // Webkit
10 | @-webkit-keyframes progress-bar-stripes {
11 | from { background-position: 40px 0; }
12 | to { background-position: 0 0; }
13 | }
14 |
15 | // Firefox
16 | @-moz-keyframes progress-bar-stripes {
17 | from { background-position: 40px 0; }
18 | to { background-position: 0 0; }
19 | }
20 |
21 | // Opera
22 | @-o-keyframes progress-bar-stripes {
23 | from { background-position: 0 0; }
24 | to { background-position: 40px 0; }
25 | }
26 |
27 | // Spec and IE10+
28 | @keyframes progress-bar-stripes {
29 | from { background-position: 40px 0; }
30 | to { background-position: 0 0; }
31 | }
32 |
33 |
34 |
35 | // Bar itself
36 | // -------------------------
37 |
38 | // Outer container
39 | .progress {
40 | overflow: hidden;
41 | height: @line-height-computed;
42 | margin-bottom: @line-height-computed;
43 | background-color: @progress-bg;
44 | border-radius: @border-radius-base;
45 | .box-shadow(inset 0 1px 2px rgba(0,0,0,.1));
46 | }
47 |
48 | // Bar of progress
49 | .progress-bar {
50 | float: left;
51 | width: 0%;
52 | height: 100%;
53 | font-size: @font-size-small;
54 | line-height: @line-height-computed;
55 | color: @progress-bar-color;
56 | text-align: center;
57 | background-color: @progress-bar-bg;
58 | .box-shadow(inset 0 -1px 0 rgba(0,0,0,.15));
59 | .transition(width .6s ease);
60 | }
61 |
62 | // Striped bars
63 | .progress-striped .progress-bar {
64 | #gradient > .striped();
65 | background-size: 40px 40px;
66 | }
67 |
68 | // Call animation for the active one
69 | .progress.active .progress-bar {
70 | -webkit-animation: progress-bar-stripes 2s linear infinite;
71 | -moz-animation: progress-bar-stripes 2s linear infinite;
72 | -ms-animation: progress-bar-stripes 2s linear infinite;
73 | -o-animation: progress-bar-stripes 2s linear infinite;
74 | animation: progress-bar-stripes 2s linear infinite;
75 | }
76 |
77 |
78 |
79 | // Variations
80 | // -------------------------
81 |
82 | .progress-bar-success {
83 | .progress-bar-variant(@progress-bar-success-bg);
84 | }
85 |
86 | .progress-bar-info {
87 | .progress-bar-variant(@progress-bar-info-bg);
88 | }
89 |
90 | .progress-bar-warning {
91 | .progress-bar-variant(@progress-bar-warning-bg);
92 | }
93 |
94 | .progress-bar-danger {
95 | .progress-bar-variant(@progress-bar-danger-bg);
96 | }
97 |
--------------------------------------------------------------------------------
/styles/components/anchors.less:
--------------------------------------------------------------------------------
1 | //
2 | // Anchors
3 | // --------------------------------------------------
4 | // Anchors show upon hovering over a heading
5 |
6 |
7 | // PLEASE DON'T CHANGE ANCHOR SIZES without
8 | // Completely understanding what they're doing.
9 | //
10 | // The anchors are used (beyond being anchors)
11 | // to ensure that headings do no overlap with
12 | // the top navbar.
13 | //
14 | // If you feel a need to change heading spacing,
15 | // this is mostl likely not the best place
16 | // to do it.
17 |
18 |
19 |
20 | // allow the container to constrain the width
21 | @anchor-width: @content-gutter; // see less-docs #203
22 | @anchor-distance: 80px;
23 | @anchor-distance-small: 40px;
24 |
25 |
26 |
27 | // Base class
28 | // ----------------------------------------------
29 | // Our "anchors" are really just icons that sit
30 | // in the left margin, and are only visible when
31 | // hovering over headings or the icons themselves.
32 |
33 | .anchor {
34 | &, &:empty{
35 | position: absolute;
36 | top: auto;
37 | bottom: 0;
38 | left: 0;
39 |
40 | color: transparent;
41 | font-size: 18px;
42 | padding: 10px 10px 10px 25px;
43 | width: @anchor-width;
44 | }
45 | }
46 |
47 | // Adjust the vertical positioning
48 | // of anchors next to larger headings.
49 |
50 | .anchor {
51 | .adjust(h2);
52 | .adjust(h3);
53 | .adjust(h4);
54 |
55 | .adjust(@tag) {
56 | @{tag} & {
57 | @tag-font-size: ~'font-size-@{tag}';
58 | margin-bottom: ceil(((@@tag-font-size - @font-size-h1) * @headings-line-height / 2));
59 | }
60 | }
61 | }
62 |
63 | // Headings
64 | // ----------------------------------------------
65 |
66 | h1, h2, h3 {
67 | position: relative;
68 | padding-left: @content-gutter;
69 | margin-left: -(@content-gutter);
70 |
71 | .anchor:hover {
72 | color: @gray-darkest;
73 | visibility: visible;
74 | text-decoration: none;
75 | }
76 | }
77 |
78 |
79 | // Offset
80 | // ----------------------------------------------
81 | // anchor targets are invisible and set the specified
82 | // distance above headings and anchors. This is what
83 | // ensures that our headings won't overlap the navbar.
84 | // If you require clickable anchors, you can
85 | // achieve this with fewer classes and less HTML
86 |
87 | .anchor-target {
88 | position: absolute;
89 | margin-top: -(@anchor-distance);
90 | padding-top: @anchor-distance;
91 | width: 2px;
92 | }
93 |
94 | .anchor-target-small {
95 | margin-top: -(@anchor-distance-small);
96 | padding-top: @anchor-distance-small;
97 | }
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | ## Contributing to the Documentation
2 |
3 | **Formatting Standards**
4 |
5 | For consistency across all examples in the docs and to ensure that our code examples are readable, please follow these guidelines when contributing:
6 |
7 | * Four spaces for indentation, and always use proper indentation
8 | * Multiple-line formatting (one property and value per line)
9 | * Double quotes only, never single quotes
10 | * Always put a space after a property's colon (.e.g, `display: block;` and not `display:block;`)
11 | * End all lines with a semi-colon
12 | * For multiple, comma-separated selectors, place each selector on its own line
13 | * Attribute selectors, like `input[type="text"]` should always wrap the attribute's value in double quotes. This is important to do in your own code as well for consistency and safety (see this [blog post on unquoted attribute values](http://mathiasbynens.be/notes/unquoted-attribute-values) that can lead to XSS attacks)
14 | * When using HTML in your examples, use tags and elements appropriate for an HTML5 doctype (e.g., self-closing tags with _no trailing slash_)
15 | * All page files should have globally unique names regardless of where they are located in the repository
16 |
17 | ### Capitalization
18 |
19 | #### In Titles: Do Capitalize
20 |
21 | * Nouns (man, bus, book)
22 | * Adjectives (angry, lovely, small)
23 | * Verbs (run, eat, sleep)
24 | * Adverbs (slowly, quickly, quietly)
25 | * Pronouns (he, she, it)
26 | * Subordinating conjunctions (as, because, that)
27 |
28 | #### In Titles: Do Not Capitalize
29 |
30 | * Articles: a, an, the
31 | * Coordinating Conjunctions: and, but, or, for, nor, etc.
32 | * Prepositions: on, at, to, from, by, etc.
33 |
34 | ## Tools
35 |
36 | ### Assemble
37 |
38 | * Visit [Assemble's documentation](http://assemble.io/docs/) site to learn more about customization and configuration.
39 | * Markdown: [Markdown Cheatsheet](http://assemble.io/docs/Cheatsheet-Markdown.html)
40 |
41 | ## Coding Style
42 |
43 | Examples:
44 |
45 | **Good**
46 |
47 | ```css
48 | body {
49 | padding-top: 80px;
50 | font-size: 12px;
51 | }
52 | ```
53 |
54 | **Bad**
55 |
56 | ```css
57 | body {
58 | padding-top: 80px;
59 | font-size: 12px;
60 | }
61 | ```
62 |
63 | **Bad**
64 |
65 | ```css
66 | body { padding-top: 80px; font-size: 12px }
67 | ```
68 |
69 | ### Feature Requests, Bugs and Pull Requests
70 |
71 | * If you would like to request a feature, suggest an improvement, or report a bug, please [submit an Issue]({{ site.codeissues }}).
72 | * Feature requests are more likely to get attention if you include a clearly-described use case.
73 |
--------------------------------------------------------------------------------
/styles/components/docs-section.less:
--------------------------------------------------------------------------------
1 | //
2 | // Docs sections
3 | // --------------------------------------------------
4 |
5 |
6 | .docs-container {
7 | margin-top: -50px;
8 | }
9 | // Space things out
10 | .docs-section {
11 | margin-bottom: 40px;
12 | }
13 | .docs-section:last-child {
14 | margin-bottom: 0;
15 | }
16 |
17 |
18 | /**
19 | * Add a width to docs-headings inside section-content,
20 | * so we easily get the .anchor when hovering over headings.
21 | *
22 | * **Example**:
23 | *
24 | * ```html
25 | *
26 | *
27 | *
28 | *
29 | *
30 | * ```
31 | */
32 |
33 | .section-content .docs-heading {
34 | max-width: 80%;
35 | margin-top: 20px;
36 | }
37 |
38 |
39 |
40 | /**
41 | * Remove the width on major headings, so we don't cause them to wrap.
42 | * This class is probably unnecessary, but we'll do it for insurance.
43 | *
44 | * **Example**:
45 | *
46 | * ```html
47 | *
48 | *
49 | *
50 | *
51 | *
52 | * ```
53 | */
54 |
55 | .page-heading .docs-heading {
56 | max-width: auto;
57 | }
58 |
59 |
60 |
61 | h1[id] {
62 | margin-top: 0;
63 | }
64 |
65 | // Make headings stand out more, give some space
66 | .docs-section {
67 | h1:first-child {
68 | margin-top: 40px;
69 | }
70 |
71 | font-family: @font-family-sans-serif;
72 | p {
73 | font-size: @font-size-large - 3;
74 | line-height: 1.5;
75 | margin: 10px 0 20px;
76 | }
77 |
78 | // Override normal paragraph styles inside blockquotes
79 | // this needs to be extra specific
80 | blockquote {
81 | position: relative;
82 | font-style: normal;
83 | font-weight: 500;
84 | color: inherit;
85 | margin: 0;
86 | border-left-style: none;
87 | padding: 0;
88 | > p {
89 | line-height: 1.5;
90 | color: inherit;
91 | padding: 0px;
92 | &:first-child {
93 | font-size: 18px;
94 | }
95 | }
96 | }
97 |
98 | td {
99 | @g: 10px;
100 | padding: 0 @g (@g / 2) 0;
101 | vertical-align: top;
102 | min-width: 150px;
103 | }
104 |
105 | img {
106 | max-width: 100%;
107 | }
108 | }
109 |
110 |
111 | // individual section of content, usually represented
112 | // by h2, h3 etc.
113 | .section-content {
114 | position: relative; // we need to set position relative for popovers
115 | }
116 |
117 |
--------------------------------------------------------------------------------
/styles/bootstrap/grid.less:
--------------------------------------------------------------------------------
1 | //
2 | // Grid system
3 | // --------------------------------------------------
4 |
5 | // Set the container width, and override it for fixed navbars in media queries
6 | .container {
7 | .container-fixed();
8 | }
9 |
10 | // mobile first defaults
11 | .row {
12 | .make-row();
13 | }
14 |
15 | // Common styles for small and large grid columns
16 | .make-grid-columns();
17 |
18 |
19 | // Extra small grid
20 | //
21 | // Grid classes for extra small devices like smartphones. No offset, push, or
22 | // pull classes are present here due to the size of the target.
23 | //
24 | // Note that `.col-xs-12` doesn't get floated on purpose--there's no need since
25 | // it's full-width.
26 |
27 | .make-grid-columns-float(xs);
28 | .make-grid(@grid-columns, xs, width);
29 | .make-grid(@grid-columns, xs, pull);
30 | .make-grid(@grid-columns, xs, push);
31 | .make-grid(@grid-columns, xs, offset);
32 |
33 |
34 | // Small grid
35 | //
36 | // Columns, offsets, pushes, and pulls for the small device range, from phones
37 | // to tablets.
38 | //
39 | // Note that `.col-sm-12` doesn't get floated on purpose--there's no need since
40 | // it's full-width.
41 |
42 | @media (min-width: @screen-sm-min) {
43 | .container {
44 | width: @container-sm;
45 | }
46 |
47 | .make-grid-columns-float(sm);
48 | .make-grid(@grid-columns, sm, width);
49 | .make-grid(@grid-columns, sm, pull);
50 | .make-grid(@grid-columns, sm, push);
51 | .make-grid(@grid-columns, sm, offset);
52 | }
53 |
54 |
55 | // Medium grid
56 | //
57 | // Columns, offsets, pushes, and pulls for the desktop device range.
58 | //
59 | // Note that `.col-md-12` doesn't get floated on purpose--there's no need since
60 | // it's full-width.
61 |
62 | @media (min-width: @screen-md-min) {
63 | .container {
64 | width: @container-md;
65 | }
66 |
67 | .make-grid-columns-float(md);
68 | .make-grid(@grid-columns, md, width);
69 | .make-grid(@grid-columns, md, pull);
70 | .make-grid(@grid-columns, md, push);
71 | .make-grid(@grid-columns, md, offset);
72 | }
73 |
74 |
75 | // Large grid
76 | //
77 | // Columns, offsets, pushes, and pulls for the large desktop device range.
78 | //
79 | // Note that `.col-lg-12` doesn't get floated on purpose--there's no need since
80 | // it's full-width.
81 |
82 | @media (min-width: @screen-lg-min) {
83 | .container {
84 | width: @container-lg;
85 | }
86 |
87 | .make-grid-columns-float(lg);
88 | .make-grid(@grid-columns, lg, width);
89 | .make-grid(@grid-columns, lg, pull);
90 | .make-grid(@grid-columns, lg, push);
91 | .make-grid(@grid-columns, lg, offset);
92 | }
93 |
94 |
--------------------------------------------------------------------------------
/data/features.yml:
--------------------------------------------------------------------------------
1 | # =============================================
2 | # PUBLISHED
3 | # =============================================
4 | # This file is only needed to ensure that the
5 | # sections build in a specific order.
6 |
7 |
8 | # The base path for features docs. Makes this easier
9 | # to update without having to change each path.
10 | base: content/features
11 |
12 | # Published documenation
13 | published:
14 | features-overview:
15 | title: Overview
16 | lead: Simple overview of the basic features
17 | files: <%= features.base %>/overview.md
18 |
19 | variables:
20 | title: Variables
21 | files: <%= features.base %>/variables.md
22 |
23 | parent-selectors:
24 | title: Parent Selectors
25 | files: <%= features.base %>/parent-selectors.md
26 |
27 | import-atrules:
28 | title: "@import At-Rules"
29 | files: <%= features.base %>/imports.md
30 |
31 | extend:
32 | title: Extend
33 | files: <%= features.base %>/extend.md
34 |
35 | merge:
36 | title: Merge properties
37 | files: <%= features.base %>/merge.md
38 |
39 | mixins:
40 | title: Mixins
41 | files: <%= features.base %>/mixins.md
42 | subs:
43 | mixins-parametric:
44 | title: Parametric Mixins
45 | files: <%= features.base %>/mixins-parametric.md
46 |
47 | mixins-as-functions:
48 | title: Using Mixins as Functions
49 | files: <%= features.base %>/mixins-as-functions.md
50 |
51 | loops:
52 | title: Recursive Mixins
53 | files: <%= features.base %>/mixin-loops.md
54 |
55 | mixin-guards:
56 | title: Mixin Guards
57 | files: <%= features.base %>/mixin-guards.md
58 |
59 | mixin-aliasing:
60 | title: Aliasing Mixins
61 | files: <%= features.base %>/mixins-aliasing.md
62 |
63 | detached-rulesets:
64 | title: Detached Rulesets
65 | files: <%= features.base %>/detached-rulesets.md
66 |
67 | maps:
68 | title: "Maps"
69 | files: <%= features.base %>/maps.md
70 |
71 | scope:
72 | title: Scope
73 | files: <%= features.base %>/scope.md
74 |
75 | css-guards:
76 | title: CSS Guards
77 | files: <%= features.base %>/css-guards.md
78 |
79 | plugin-atrules:
80 | title: "@plugin At-Rules"
81 | files: <%= features.base %>/plugins.md
82 |
83 |
84 |
85 | # =============================================
86 | # NOT PUBLISHED / PLANNED / WIP
87 | # =============================================
88 |
89 | unpublished:
90 | strict-math:
91 | published: false
92 | title: Strict Math
93 | files: <%= features.base %>/strict-math.md
94 |
--------------------------------------------------------------------------------
/assets/root/feed.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Less.js
7 | Sun, 26 Jan 2014 00:00:00 +0000
8 | http://lesscss.org
9 |
10 | Alexis Sellier
11 | self@cloudhead.net
12 |
13 | Copyright (c) 2009-2014, Alexis Sellier. All rights reserved.
14 |
15 |
16 |
17 | About
18 |
19 | Sun, 26 Jan 2014 20:58:34 +0000
20 | http://lesscss.org/about
21 |
22 |
23 |
24 |
25 |
26 | Blog
27 |
28 | Sun, 26 Jan 2014 20:58:34 +0000
29 | http://lesscss.org/blog
30 |
31 |
32 |
33 |
34 |
35 | Cheatsheet
36 |
37 | Sun, 26 Jan 2014 20:58:34 +0000
38 | http://lesscss.org/cheatsheet
39 |
40 |
41 |
42 |
43 |
44 | Language Features
45 |
46 | Sun, 26 Jan 2014 20:58:34 +0000
47 | http://lesscss.org/features
48 |
49 |
50 |
51 |
52 |
53 | Functions
54 |
55 | Sun, 26 Jan 2014 20:58:34 +0000
56 | http://lesscss.org/functions
57 |
58 |
59 |
60 |
61 |
62 | Getting started
63 |
64 | Sun, 26 Jan 2014 20:58:34 +0000
65 | http://lesscss.org/index
66 |
67 |
68 |
69 |
70 |
71 | Plugins
72 |
73 | Sun, 26 Jan 2014 20:58:34 +0000
74 | http://lesscss.org/plugins
75 |
76 |
77 |
78 |
79 |
80 | Usage
81 |
82 | Sun, 26 Jan 2014 20:58:34 +0000
83 | http://lesscss.org/usage
84 |
85 |
86 |
87 |
--------------------------------------------------------------------------------
/content/features/maps.md:
--------------------------------------------------------------------------------
1 | Released [v3.5.0]({{ less.master.url }}CHANGELOG.md)
2 |
3 | > Use rulesets and mixins as maps of values
4 |
5 | By combining namespacing with the lookup `[]` syntax, you can turn your rulesets / mixins into maps.
6 |
7 | ```less
8 | @sizes: {
9 | mobile: 320px;
10 | tablet: 768px;
11 | desktop: 1024px;
12 | }
13 |
14 | .navbar {
15 | display: block;
16 |
17 | @media (min-width: @sizes[tablet]) {
18 | display: inline-block;
19 | }
20 | }
21 | ```
22 | Outputs:
23 | ```css
24 | .navbar {
25 | display: block;
26 | }
27 | @media (min-width: 768px) {
28 | .navbar {
29 | display: inline-block;
30 | }
31 | }
32 | ```
33 |
34 | Mixins are a little more versatile as maps because of namespacing and the ability to overload mixins.
35 |
36 | ```less
37 | #library() {
38 | .colors() {
39 | primary: green;
40 | secondary: blue;
41 | }
42 | }
43 |
44 | #library() {
45 | .colors() { primary: grey; }
46 | }
47 |
48 | .button {
49 | color: #library.colors[primary];
50 | border-color: #library.colors[secondary];
51 | }
52 | ```
53 | Outputs:
54 | ```css
55 | .button {
56 | color: grey;
57 | border-color: blue;
58 | }
59 | ```
60 |
61 | You can also make this easier by [aliasing mixins](#mixins-feature-mixin-aliasing-feature). That is:
62 |
63 | ```less
64 | .button {
65 | @colors: #library.colors();
66 | color: @colors[primary];
67 | border-color: @colors[secondary];
68 | }
69 | ```
70 |
71 | Note, if a lookup value produces another ruleset, you can append a second `[]` lookup, as in:
72 |
73 | ```less
74 | @config: {
75 | @options: {
76 | library-on: true
77 | }
78 | }
79 |
80 | & when (@config[@options][library-on] = true) {
81 | .produce-ruleset {
82 | prop: val;
83 | }
84 | }
85 | ```
86 |
87 | In this way, rulesets and variable calls can emulate a type of "namespacing", similar to mixins.
88 |
89 | As far as whether to use mixins or rulesets assigned to variables as maps, it's up to you. You may want to replace entire maps by re-declaring a variable assigned to a rulset. Or you may want to "merge" individual key/value pairs, in which case mixins as maps might be more appropriate.
90 |
91 | ### Using variable variables in lookups
92 |
93 | One important thing to notice is that the value in `[@lookup]` is the key (variable) name `@lookup`, and is not evaluated as a variable. If you want the key name itself to be variable, you can use the `@@variable` syntax.
94 |
95 | E.g.
96 | ```less
97 | .foods() {
98 | @dessert: ice cream;
99 | }
100 |
101 | @key-to-lookup: dessert;
102 |
103 | .lunch {
104 | treat: .foods[@@key-to-lookup];
105 | }
106 | ```
107 | This would output:
108 | ```css
109 | .lunch {
110 | treat: ice cream;
111 | }
112 | ```
--------------------------------------------------------------------------------
/styles/components/sidebar.less:
--------------------------------------------------------------------------------
1 | //
2 | // Side navigation
3 | // --------------------------------------------------
4 | // Scrollspy and affixed-enhanced navigation,
5 | // to highlight sections and secondary
6 | // sections of docs content.
7 |
8 |
9 | // Variables
10 | @sidenav-link-color: #36556E;
11 |
12 |
13 | // Hide the sidenav on smaller screens
14 | .sidebar {
15 | display: none;
16 | }
17 |
18 | // By default it's not affixed in
19 | // mobile views, so undo that
20 | .sidebar.affix {
21 | position: static;
22 | }
23 |
24 |
25 | /* First level of nav */
26 | .sidenav {
27 | margin-top: 6px;
28 | margin-bottom: 30px;
29 | padding-top: 10px;
30 | padding-bottom: 10px;
31 | text-shadow: 0 1px 0 rgba(255,255,255,.5);
32 | background-color: @gray-lightest;
33 | border-radius: 5px;
34 | }
35 |
36 | /* All levels of nav */
37 | .sidebar .nav > li > a {
38 | display: block;
39 | color: @sidenav-link-color;
40 | padding: 5px 20px;
41 | }
42 | .sidebar .nav > li > a:hover,
43 | .sidebar .nav > li > a:focus {
44 | text-decoration: none;
45 | background-color: #e8ebee;
46 | border-right: 1px solid #d8dde2;
47 | }
48 | .sidebar .nav > .active > a,
49 | .sidebar .nav > .active:hover > a,
50 | .sidebar .nav > .active:focus > a {
51 | font-weight: bold;
52 | color: @navbar-inverse-bg;
53 | background-color: transparent;
54 | border-right: 1px solid @navbar-inverse-bg;
55 | }
56 |
57 | // Nav: second (nested) level (shown on .active)
58 | .sidebar .nav .nav {
59 | display: none; // Hide by default, show when > 768px
60 | margin-bottom: 8px;
61 |
62 | > li > a {
63 | padding: 3px 30px;
64 | font-size: 90%;
65 | }
66 | }
67 |
68 | // Icons
69 | .sidebar .glyphicon {
70 | font-size: 12px;
71 | margin-left: 10px
72 | }
73 |
74 |
75 |
76 | // Show and affix the side nav when space allows it
77 | @media (min-width: 992px) {
78 | // Show the sidenav on larger screens
79 | .sidebar {
80 | display: block;
81 | padding-top: 65px;
82 | }
83 | .sidebar .nav > .active > ul {
84 | display: block;
85 | }
86 | // Widen the fixed sidebar
87 | .sidebar.affix,
88 | .sidebar.affix-bottom {
89 | width: 213px;
90 | }
91 | .sidebar.affix {
92 | position: fixed; // Undo the static from mobile first approach
93 | top: 15px;
94 | bottom: 0;
95 | overflow: auto;
96 | }
97 | .sidebar.affix-bottom {
98 | position: absolute; // Undo the static from mobile first approach
99 | }
100 | .sidebar.affix .sidenav,
101 | .sidebar.affix-bottom .sidenav {
102 | margin-top: 10px;
103 | margin-bottom: 0;
104 | }
105 | }
106 |
107 |
108 | @media (min-width: 1200px) {
109 |
110 | // Widen the fixed sidebar again
111 | .sidebar.affix-bottom,
112 | .sidebar.affix {
113 | width: 263px;
114 | }
115 | }
116 |
--------------------------------------------------------------------------------
/styles/bootstrap/tooltip.less:
--------------------------------------------------------------------------------
1 | //
2 | // Tooltips
3 | // --------------------------------------------------
4 |
5 |
6 | // Base class
7 | .tooltip {
8 | position: absolute;
9 | z-index: @zindex-tooltip;
10 | display: block;
11 | visibility: visible;
12 | font-size: @font-size-small;
13 | line-height: 1.4;
14 | .opacity(0);
15 |
16 | &.in { .opacity(.9); }
17 | &.top { margin-top: -3px; padding: @tooltip-arrow-width 0; }
18 | &.right { margin-left: 3px; padding: 0 @tooltip-arrow-width; }
19 | &.bottom { margin-top: 3px; padding: @tooltip-arrow-width 0; }
20 | &.left { margin-left: -3px; padding: 0 @tooltip-arrow-width; }
21 | }
22 |
23 | // Wrapper for the tooltip content
24 | .tooltip-inner {
25 | max-width: @tooltip-max-width;
26 | padding: 3px 8px;
27 | color: @tooltip-color;
28 | text-align: center;
29 | text-decoration: none;
30 | background-color: @tooltip-bg;
31 | border-radius: @border-radius-base;
32 | }
33 |
34 | // Arrows
35 | .tooltip-arrow {
36 | position: absolute;
37 | width: 0;
38 | height: 0;
39 | border-color: transparent;
40 | border-style: solid;
41 | }
42 | .tooltip {
43 | &.top .tooltip-arrow {
44 | bottom: 0;
45 | left: 50%;
46 | margin-left: -@tooltip-arrow-width;
47 | border-width: @tooltip-arrow-width @tooltip-arrow-width 0;
48 | border-top-color: @tooltip-arrow-color;
49 | }
50 | &.top-left .tooltip-arrow {
51 | bottom: 0;
52 | left: @tooltip-arrow-width;
53 | border-width: @tooltip-arrow-width @tooltip-arrow-width 0;
54 | border-top-color: @tooltip-arrow-color;
55 | }
56 | &.top-right .tooltip-arrow {
57 | bottom: 0;
58 | right: @tooltip-arrow-width;
59 | border-width: @tooltip-arrow-width @tooltip-arrow-width 0;
60 | border-top-color: @tooltip-arrow-color;
61 | }
62 | &.right .tooltip-arrow {
63 | top: 50%;
64 | left: 0;
65 | margin-top: -@tooltip-arrow-width;
66 | border-width: @tooltip-arrow-width @tooltip-arrow-width @tooltip-arrow-width 0;
67 | border-right-color: @tooltip-arrow-color;
68 | }
69 | &.left .tooltip-arrow {
70 | top: 50%;
71 | right: 0;
72 | margin-top: -@tooltip-arrow-width;
73 | border-width: @tooltip-arrow-width 0 @tooltip-arrow-width @tooltip-arrow-width;
74 | border-left-color: @tooltip-arrow-color;
75 | }
76 | &.bottom .tooltip-arrow {
77 | top: 0;
78 | left: 50%;
79 | margin-left: -@tooltip-arrow-width;
80 | border-width: 0 @tooltip-arrow-width @tooltip-arrow-width;
81 | border-bottom-color: @tooltip-arrow-color;
82 | }
83 | &.bottom-left .tooltip-arrow {
84 | top: 0;
85 | left: @tooltip-arrow-width;
86 | border-width: 0 @tooltip-arrow-width @tooltip-arrow-width;
87 | border-bottom-color: @tooltip-arrow-color;
88 | }
89 | &.bottom-right .tooltip-arrow {
90 | top: 0;
91 | right: @tooltip-arrow-width;
92 | border-width: 0 @tooltip-arrow-width @tooltip-arrow-width;
93 | border-bottom-color: @tooltip-arrow-color;
94 | }
95 | }
96 |
--------------------------------------------------------------------------------
/content/tools/guis-for-less.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: GUIs for Less.js
3 | ---
4 |
5 |
**Tip**: try out the different Less tools available for your platform to see which one meets your needs.
6 |
7 | _This page focuses on GUI compilers. For command line usage and tools see [Command Line Usage](#command-line-usage)._
8 |
9 | ## Cross platform
10 |
11 | ### [Crunch 2!](http://getcrunch.co/)
12 |
13 | > The editor and compiler for awesome people.
14 |
15 | Crunch 2 is a cross-platform (Windows, Mac, and Linux) editor with integrated compiling. If you work with large Less projects, you should definitely try it out, as you only need the free version for Less files. Available at: [https://getcrunch.co/](http://getcrunch.co/).
16 |
17 |
18 | 
19 |
20 |
21 | ### [Koala](http://koala-app.com/)
22 |
23 | > Koala is a cross-platform GUI application for compiling less, sass and coffeescript.
24 |
25 | Features: cross platform, compile error notification supports and compile options supports.
26 |
27 | Get more info: [http://koala-app.com/](http://koala-app.com/)
28 |
29 | 
30 |
31 | #### [Prepros](https://prepros.io/)
32 | > Prepros is a tool to compile Less, Sass, Compass, Stylus, Jade and much more.
33 |
34 | Get more info at [https://prepros.io/](https://prepros.io/)
35 |
36 | 
37 |
38 |
39 | ## Specific platforms
40 |
41 | ### Windows
42 |
43 | #### [WinLess](http://winless.org)
44 |
45 | > WinLess started out as a clone of Less.app, it takes a more feature-complete approach and has several settings. It also supports starting with command line arguments.
46 |
47 | Get more info: [http://winless.org](http://winless.org)
48 |
49 | 
50 |
51 | ### OS X
52 |
53 | #### [CodeKit](http://incident57.com/codekit)
54 |
55 | > CodeKit is the successor to LESS.app, and supports Less among many other preprocessing languages, such as SASS, Jade, Markdown, and many more.
56 |
57 | Get more info: [http://incident57.com/codekit](http://incident57.com/codekit)
58 |
59 | 
60 |
61 | #### [LiveReload](http://livereload.com)
62 |
63 | > CSS edits and image changes apply live. CoffeeScript, SASS, Less and others just work.
64 |
65 | Get more info: [http://livereload.com](http://livereload.com)
66 |
67 | 
68 |
69 | ### Linux
70 |
71 | #### [Plessc](https://github.com/Mte90/Plessc)
72 |
73 | > Plessc is a gui fronted made with PyQT.
74 |
75 | Auto compile, log viewer, open the less file with the editor chosen, settings for compile the file.
76 | Get more info: [https://github.com/Mte90/Plessc](https://github.com/Mte90/Plessc)
77 |
78 | 
79 |
--------------------------------------------------------------------------------
/content/usage/command-line-usage.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Command Line Usage
3 | ---
4 |
5 | > Compile `.less` files to `.css` using the command line
6 |
7 |
Heads up! If the command line isn't your thing, learn more about [GUIs for Less](../tools/#guis-for-less).
8 |
9 | ## Installing
10 |
11 | Install with [npm](https://www.npmjs.org/)
12 |
13 | ```bash
14 | npm install less -g
15 | ```
16 |
17 | The `-g` option installs the `lessc` command available globally. For a specific version (or tag) you can add `@VERSION` after our package name, e.g. `npm install less@2.7.1 -g`.
18 |
19 | ### Installing for Node Development
20 |
21 | Alternatively, if you don't want to use the compiler globally, you may be after
22 |
23 | ```bash
24 | npm i less --save-dev
25 | ```
26 |
27 | This will install the latest official version of lessc in your project folder, also adding it to the `devDependencies` in your project's `package.json`.
28 |
29 | ### Beta releases of lessc
30 |
31 | Periodically, as new functionality is being developed, lessc builds will be published to npm, tagged as beta. These builds will _not_ be published as a `@latest` official release, and will typically have beta in the version (use `lessc -v` to get current version).
32 |
33 | Since patch releases are non-breaking we will publish patch releases immediately and alpha/beta/candidate versions will be published as minor or major version upgrades (we endeavour since 1.4.0 to follow [semantic versioning](http://semver.org/)).
34 |
35 |
36 | ## Server-Side and Command Line Usage
37 |
38 | The binary included in this repository, `bin/lessc` works with [Node.js](http://nodejs.org/) on *nix, OS X and Windows.
39 |
40 | **Usage**: `lessc [option option=parameter ...]
[destination]`
41 |
42 | ### Command Line Usage
43 |
44 | ```bash
45 | lessc [option option=parameter ...] [destination]
46 | ```
47 |
48 | If source is set to `-' (dash or hyphen-minus), input is read from stdin.
49 |
50 | #### Examples
51 |
52 | Compile bootstrap.less to bootstrap.css
53 |
54 | ```bash
55 | lessc bootstrap.less bootstrap.css
56 | ```
57 |
58 | ## Options specific to `lessc`
59 |
60 | _For all other options, see [Less Options](#less-options)._
61 |
62 | #### Silent
63 |
64 | lessc -s
65 | lessc --silent
66 |
67 | Stops any warnings from being shown.
68 |
69 | #### Version
70 |
71 | ```bash
72 | lessc -v
73 | lessc --version
74 | ```
75 | #### Help
76 |
77 | | | |
78 | |---|---|
79 | | `lessc --help` | |
80 | | `lessc -h` | |
81 |
82 | Prints a help message with available options and exits.
83 |
84 | #### Makefile
85 |
86 | ```bash
87 | lessc -M
88 | lessc --depends
89 | ```
90 |
91 | Outputs a makefile import dependency list to stdout.
92 |
93 | #### No Color
94 |
95 | *Deprecated*.
96 |
97 | ```bash
98 | lessc --no-color
99 | ```
100 |
101 | #### Clean CSS
102 |
103 | In v2 of less, Clean CSS is no longer included as a direct dependency. To use clean css with lessc, use the [clean css plugin](https://github.com/less/less-plugin-clean-css).
104 |
105 |
106 |
--------------------------------------------------------------------------------
/content/features/mixin-guards.md:
--------------------------------------------------------------------------------
1 | Guards are useful when you want to match on _expressions_, as opposed to simple values or arity. If you are familiar with functional programming, you have probably encountered them already.
2 |
3 | In trying to stay as close as possible to the declarative nature of CSS, Less has opted to implement conditional execution via **guarded mixins** instead of `if`/`else` statements, in the vein of `@media` query feature specifications.
4 |
5 | Let's start with an example:
6 |
7 | ```less
8 | .mixin(@a) when (lightness(@a) >= 50%) {
9 | background-color: black;
10 | }
11 | .mixin(@a) when (lightness(@a) < 50%) {
12 | background-color: white;
13 | }
14 | .mixin(@a) {
15 | color: @a;
16 | }
17 | ```
18 |
19 | The key is the `when` keyword, which introduces a guard sequence (here with only one guard). Now if we run the following code:
20 |
21 | ```less
22 | .class1 { .mixin(#ddd) }
23 | .class2 { .mixin(#555) }
24 | ```
25 |
26 | Here's what we'll get:
27 |
28 | ```css
29 | .class1 {
30 | background-color: black;
31 | color: #ddd;
32 | }
33 | .class2 {
34 | background-color: white;
35 | color: #555;
36 | }
37 | ```
38 |
39 | #### Guard Comparison Operators
40 |
41 | The full list of comparison operators usable in guards are: `>`, `>=`, `=`, `=<`, `<`. Additionally, the keyword `true` is the only truthy value, making these two mixins equivalent:
42 |
43 | ```less
44 | .truth(@a) when (@a) { ... }
45 | .truth(@a) when (@a = true) { ... }
46 | ```
47 |
48 | Any value other than the keyword `true` is falsy:
49 |
50 | ```less
51 | .class {
52 | .truth(40); // Will not match any of the above definitions.
53 | }
54 | ```
55 |
56 | Note that you can also compare arguments with each other, or with non-arguments:
57 |
58 | ```less
59 | @media: mobile;
60 |
61 | .mixin(@a) when (@media = mobile) { ... }
62 | .mixin(@a) when (@media = desktop) { ... }
63 |
64 | .max(@a; @b) when (@a > @b) { width: @a }
65 | .max(@a; @b) when (@a < @b) { width: @b }
66 | ```
67 |
68 | #### Guard Logical Operators
69 |
70 | You can use logical operators with guards. The syntax is based on CSS media queries.
71 |
72 | Use the `and` keyword to combine guards:
73 |
74 | ```less
75 | .mixin(@a) when (isnumber(@a)) and (@a > 0) { ... }
76 | ```
77 |
78 | You can emulate the *or* operator by separating guards with a comma `,`. If any of the guards evaluate to true, it's considered a match:
79 |
80 | ```less
81 | .mixin(@a) when (@a > 10), (@a < -10) { ... }
82 | ```
83 |
84 | Use the `not` keyword to negate conditions:
85 |
86 | ```less
87 | .mixin(@b) when not (@b > 0) { ... }
88 | ```
89 |
90 | #### Type Checking Functions
91 |
92 | Lastly, if you want to match mixins based on value type, you can use the `is` functions:
93 |
94 | ```less
95 | .mixin(@a; @b: 0) when (isnumber(@b)) { ... }
96 | .mixin(@a; @b: black) when (iscolor(@b)) { ... }
97 | ```
98 |
99 | Here are the basic type checking functions:
100 |
101 | * `iscolor`
102 | * `isnumber`
103 | * `isstring`
104 | * `iskeyword`
105 | * `isurl`
106 |
107 | If you want to check if a value is in a specific unit in addition to being a number, you may use one of:
108 |
109 | * `ispixel`
110 | * `ispercentage`
111 | * `isem`
112 | * `isunit`
113 |
--------------------------------------------------------------------------------
/assets/public/js/application.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * Adapted from Bootstrap docs JavaScript
3 | */
4 |
5 |
6 | !function ($) {
7 |
8 | $(function () {
9 |
10 | // IE10 viewport hack for Surface/desktop Windows 8 bug
11 | //
12 | // See Getting Started docs for more information
13 | if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
14 | var msViewportStyle = document.createElement('style')
15 | msViewportStyle.appendChild(
16 | document.createTextNode(
17 | '@-ms-viewport{width:auto!important}'
18 | )
19 | )
20 | document.querySelector('head').appendChild(msViewportStyle)
21 | }
22 |
23 | var $window = $(window)
24 | var $body = $(document.body)
25 |
26 | $body.scrollspy({
27 | target: '.sidebar',
28 | offset: 40 // required to select the right thing. if this is smaller then you are at the top of one section
29 | // but the next section is highlighted
30 | });
31 |
32 | $window.on('load', function () {
33 | $body.scrollspy('refresh')
34 | });
35 |
36 | $('.docs-container [href=#]').click(function (e) {
37 | e.preventDefault()
38 | });
39 |
40 |
41 | $('.source-link').each(function () {
42 | var id = $(this).data('content');
43 | var content = $('').append($('#' + id)).html();
44 | $(this).attr('data-content', content);
45 |
46 | // Keep popovers open when hovered
47 | $(this).popover({
48 | trigger: 'manual',
49 | container: 'body',
50 | placement: 'left',
51 | template: '',
52 | html: true,
53 | delay: {show: 50, hide: 750}
54 | }).on('mouseenter', function () {
55 | var self = this;
56 | $(this).popover('show');
57 | $(this).addClass('active');
58 | $(this).addClass('popover-source');
59 |
60 | $('.popover').on('mouseleave', function () {
61 | $(self).popover('hide');
62 | $(self).removeClass('active');
63 | });
64 |
65 | }).on('mouseleave', function () {
66 | var self = this;
67 | setTimeout(function () {
68 | if (!$('.popover:hover').length) {
69 | $(self).popover('hide');
70 | $(self).removeClass('active');
71 | }
72 | }, 100);
73 | });
74 | });
75 |
76 |
77 | // back to top
78 | // setTimeout(function () {
79 | var $sideBar = $('.sidebar')
80 |
81 | /** @todo - replace this with position: sticky */
82 | $sideBar.affix({
83 | offset: {
84 | top: function () {
85 | var offsetTop = $sideBar.offset().top
86 | var sideBarMargin = parseInt($sideBar.children(0).css('margin-top'), 10)
87 | var navOuterHeight = $('.docs-nav').height()
88 |
89 | return (this.top = offsetTop - navOuterHeight - sideBarMargin + 15)
90 | },
91 | bottom: function () {
92 | return (this.bottom = $('.footer').outerHeight(true))
93 | }
94 | }
95 | })
96 | // }, 100);
97 |
98 | // setTimeout(function () {
99 | $('.top').affix()
100 | // }, 100);
101 |
102 | })
103 |
104 | }(jQuery)
105 |
--------------------------------------------------------------------------------
/content/tools/plugins.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Less Plugins
3 | ---
4 | > Available Less plugins. Find more at [GitHub](https://github.com/search?q=topic%3Aless-plugin&type=Repositories) and [NPM Registry](https://www.npmjs.com/search?q=%22less-plugin%22)
5 |
6 | #### Postprocessor/Feature Plugins
7 | | | |
8 | |---|---|
9 | | [Autoprefixer](https://github.com/less/less-plugin-autoprefix) | Add vendor prefixes
10 | | [CSScomb](https://github.com/bassjobsen/less-plugin-csscomb/) | Beautify/format
11 | | [clean-css](https://github.com/less/less-plugin-clean-css) | Compress/minify
12 | | [CSSWring](https://github.com/bassjobsen/less-plugin-csswring) | Compress/minify
13 | | [css-flip](https://github.com/bassjobsen/less-plugin-css-flip) | Generate left-to-right (LTR) or right-to-left (RTL) CSS
14 | | [functions](https://github.com/seven-phases-max/less-plugin-functions) | Write custom Less functions in Less itself
15 | | [group-css-media-queries](https://github.com/bassjobsen/less-plugin-group-css-media-queries) | Group CSS media queries
16 | | [inline-urls](https://github.com/less/less-plugin-inline-urls) | Convert `url()` to a call to `data-uri()`
17 | | [lesshint](https://github.com/lesshint/lesshint) | Lint your Less
18 | | [lists](https://github.com/seven-phases-max/less-plugin-lists) | Lists/arrays manipulation (incl. loops)
19 | | [pleeease](https://github.com/bassjobsen/less-plugin-pleeease) | Postprocess using pleeease
20 | | [rtl](https://github.com/less/less-plugin-rtl) | Reverse from ltr to rtl
21 | | [variables-output](https://github.com/Craga89/less-plugin-variables-output) | Export top-level variables to a JSON file
22 |
23 | #### Preprocessors
24 | | | |
25 | |---|---|
26 | | [sass2less](https://github.com/mediafreakch/less-plugin-sass2less) | Import and convert Sass/SCSS files into your Less code (incl. variables, mixins and more)
27 |
28 | #### Import Plugins
29 | | | |
30 | |---|---|
31 | | [bower-resolve](https://github.com/Mercateo/less-plugin-bower-resolve) | Import from a Bower package
32 | | [glob](https://github.com/just-boris/less-plugin-glob) | Globbing support in Less imports
33 | | [npm-import](https://github.com/less/less-plugin-npm-import) | Import from npm packages
34 | | [resolve-blocks](https://github.com/Dalee/less-plugin-resolve-blocks) | Going up a tree to find specified component
35 |
36 | #### Function Libraries
37 | | | |
38 | |---|---|
39 | | [advanced-color-functions](https://github.com/less/less-plugin-advanced-color-functions/) | Functions to find more contrast colors
40 | | [cubehelix](https://github.com/bassjobsen/less-plugin-cubehelix) | A `cubehelix` function
41 | | [lists](https://github.com/seven-phases-max/less-plugin-lists) | Lists/arrays manipulation functions
42 | | [urlencode](https://github.com/calvinjuarez/less-plugin-urlencode) | URL Encode function
43 | | [util](https://github.com/FaberVitale/less-plugin-util) | A set of utility functions
44 |
45 | #### Framework Importers
46 | | | |
47 | |---|---|
48 | | [Bootstrap](https://github.com/bassjobsen/less-plugin-bootstrap/) | Bootstrap
49 | | [Cardinal](https://github.com/bassjobsen/less-plugin-cardinal) | Cardinal
50 | | [Flexbox Grid](https://github.com/bassjobsen/less-plugin-flexboxgrid) | [Flexbox Grid](http://flexboxgrid.com/)
51 | | [Flexible Grid System](https://github.com/bassjobsen/less-plugin-flexiblegs) | [Flexible Grid System](https://dnomak.com/flexiblegs/)
52 | | [Ionic](https://github.com/bassjobsen/less-plugin-ionic) | Ionic
53 | | [Lesshat](https://github.com/bassjobsen/less-plugin-lesshat/) | Lesshat
54 | | [Skeleton](https://github.com/bassjobsen/less-plugin-skeleton) | Skeleton
55 |
--------------------------------------------------------------------------------
/content/functions/color-definition.md:
--------------------------------------------------------------------------------
1 | ### rgb
2 |
3 | > Creates an opaque color object from decimal red, green and blue (RGB) values.
4 |
5 | Literal color values in standard HTML/CSS formats may also be used to define colors, for example `#ff0000`.
6 |
7 | Parameters:
8 | * `red`: An integer 0-255 or percentage 0-100%.
9 | * `green`: An integer 0-255 or percentage 0-100%.
10 | * `blue`: An integer 0-255 or percentage 0-100%.
11 |
12 | Returns: `color`
13 |
14 | Example: `rgb(90, 129, 32)`
15 |
16 | Output: `#5a8120`
17 |
18 |
19 | ### rgba
20 |
21 | > Creates a transparent color object from decimal red, green, blue and alpha (RGBA) values.
22 |
23 | Parameters:
24 |
25 | * `red`: An integer 0-255 or percentage 0-100%.
26 | * `green`: An integer 0-255 or percentage 0-100%.
27 | * `blue`: An integer 0-255 or percentage 0-100%.
28 | * `alpha`: A number 0-1 or percentage 0-100%.
29 |
30 | Returns: `color`
31 |
32 | Example: `rgba(90, 129, 32, 0.5)`
33 |
34 | Output: `rgba(90, 129, 32, 0.5)`
35 |
36 |
37 | ### argb
38 |
39 | > Creates a hex representation of a color in `#AARRGGBB` format (**NOT** `#RRGGBBAA`!).
40 |
41 | This format is used in Internet Explorer, and .NET and Android development.
42 |
43 | Parameters: `color`, color object.
44 |
45 | Returns: `string`
46 |
47 | Example: `argb(rgba(90, 23, 148, 0.5));`
48 |
49 | Output: `#805a1794`
50 |
51 |
52 | ### hsl
53 |
54 | > Creates an opaque color object from hue, saturation and lightness (HSL) values.
55 |
56 | Parameters:
57 |
58 | * `hue`: An integer 0-360 representing degrees.
59 | * `saturation`: A percentage 0-100% or number 0-1.
60 | * `lightness`: A percentage 0-100% or number 0-1.
61 |
62 | Returns: `color`
63 |
64 | Example: `hsl(90, 100%, 50%)`
65 |
66 | Output: `#80ff00`
67 |
68 | This is useful if you want to create a new color based on another color's channel, forExample: `@new: hsl(hue(@old), 45%, 90%);`
69 |
70 | `@new` will have `@old`'s *hue*, and its own saturation and lightness.
71 |
72 |
73 | ### hsla
74 |
75 | > Creates a transparent color object from hue, saturation, lightness and alpha (HSLA) values.
76 |
77 | Parameters:
78 | * `hue`: An integer 0-360 representing degrees.
79 | * `saturation`: A percentage 0-100% or number 0-1.
80 | * `lightness`: A percentage 0-100% or number 0-1.
81 | * `alpha`: A percentage 0-100% or number 0-1.
82 |
83 | Returns: `color`
84 |
85 | Example: `hsla(90, 100%, 50%, 0.5)`
86 |
87 | Output: `rgba(128, 255, 0, 0.5)`
88 |
89 |
90 | ### hsv
91 |
92 | > Creates an opaque color object from hue, saturation and value (HSV) values.
93 |
94 | Note that this is a color space available in Photoshop, and is not the same as `hsl`.
95 |
96 | Parameters:
97 | * `hue`: An integer 0-360 representing degrees.
98 | * `saturation`: A percentage 0-100% or number 0-1.
99 | * `value`: A percentage 0-100% or number 0-1.
100 |
101 | Returns: `color`
102 |
103 | Example: `hsv(90, 100%, 50%)`
104 |
105 | Output: `#408000`
106 |
107 |
108 | ### hsva
109 |
110 | > Creates a transparent color object from hue, saturation, value and alpha (HSVA) values.
111 |
112 | Note that this is not the same as `hsla`, and is a color space available in Photoshop.
113 |
114 | Parameters:
115 | * `hue`: An integer 0-360 representing degrees.
116 | * `saturation`: A percentage 0-100% or number 0-1.
117 | * `value`: A percentage 0-100% or number 0-1.
118 | * `alpha`: A percentage 0-100% or number 0-1.
119 |
120 | Returns: `color`
121 |
122 | Example: `hsva(90, 100%, 50%, 0.5)`
123 |
124 | Output: `rgba(64, 128, 0, 0.5)`
125 |
--------------------------------------------------------------------------------
/content/usage/developing-less.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: Developing Less
3 | ---
4 |
5 | Thanks for thinking about contributing! Please read the [contributing instructions]({{ less.master.url }}CONTRIBUTING.md) carefully to avoid wasted work.
6 |
7 | ## Install These Tools
8 |
9 | * **node** -
10 | * **phantomjs** -
11 |
12 | make sure the paths are setup. If you start your favourite command line and type `node -v` you should see the node compiler. If you run `phantomjs -v` you should see the phantomjs version number.
13 |
14 | * clone your less.js repository locally
15 | * navigate to your local less.js repository and run `npm install` this installs less' npm dependencies.
16 |
17 | ## Usage
18 |
19 | [Grunt](https://gruntjs.com/) is used in order to run development commands such as tests, builds, and benchmarks. You can run them either with `grunt [command_name]` if you have `grunt-cli` installed globally or with `npm run grunt -- [command_name]`.
20 |
21 | If you go to the root of the Less repository you should be able to do `npm test` (a handy alias for `npm run grunt -- test`) - this should run all the tests. For the browser specific only, run `npm run grunt -- browsertest` If you want to try out the current version of less against a file, from here do `node bin/lessc path/to/file.less`
22 |
23 | To debug the browser tests, run `npm run grunt -- browsertest-server` then go to http://localhost:8088/tmp/browser/ to see the test runner pages.
24 |
25 | Optional: To get the current version of the Less compiler do `npm -g install less` - npm is the node package manager and "-g" installs it to be available globally.
26 |
27 | You should now be able to do `lessc file.less` and if there is an appropriate `file.less` then it will be compiled and output to the stdout. You can then compare it to running locally (`node bin/lessc file.less`).
28 |
29 | Other grunt commands
30 |
31 | * `npm run grunt -- benchmark` - run our benchmark tests to get some numbers on performance
32 | * `npm run grunt -- stable` to create a new release
33 | * `npm run grunt -- readme` to generate a new readme.md in the root directory (after each release)
34 |
35 | ## How to Run Less in Other Environments
36 |
37 | If you look in the libs folder you will see `less`, `less-node`, `less-browser`. The `less` folder is pure javascript with no environment
38 | specifics. if you require `less/libs/less`, you get a function that takes an environment object and an array of file managers. The file
39 | managers are the same file managers that can also be written as a plugin.
40 |
41 | ```js
42 | var createLess = require("less/libs/less"),
43 | myLess = createLess(environment, [myFileManager]);
44 | ```
45 |
46 | The environment api is specified in [less/libs/less/environment/environment-api.js](https://github.com/less/less.js/blob/master/lib/less/environment/environment-api.js)
47 | and the file manager api is specified in [less/libs/less/environment/file-manager-api.js](https://github.com/less/less.js/blob/master/lib/less/environment/file-manager-api.js).
48 |
49 | For file managers we highly recommend setting the prototype as a new AbstractFileManager - this allows you to override what is needed and allows us
50 | to implement new functions without breaking existing file managers. For an example of file managers, see the 2 node implementations, the browser implementation or
51 | the npm import plugin implementation.
52 |
53 | ## Guide
54 |
55 | If you look at [http://www.gliffy.com/go/publish/4784259](http://www.gliffy.com/go/publish/4784259), This is an overview diagram of how less works. Warning! It needs updating with v2 changes.
56 |
--------------------------------------------------------------------------------
/content/functions/color-channel.md:
--------------------------------------------------------------------------------
1 | ### hue
2 |
3 | > Extracts the hue channel of a color object in the HSL color space.
4 |
5 | Parameters: `color` - a color object.
6 |
7 | Returns: `integer` 0-360
8 |
9 | Example: `hue(hsl(90, 100%, 50%))`
10 |
11 | Output: `90`
12 |
13 |
14 | ### saturation
15 |
16 | > Extracts the saturation channel of a color object in the HSL color space.
17 |
18 | Parameters: `color` - a color object.
19 |
20 | Returns: `percentage` 0-100
21 |
22 | Example: `saturation(hsl(90, 100%, 50%))`
23 |
24 | Output: `100%`
25 |
26 |
27 | ### lightness
28 |
29 | > Extracts the lightness channel of a color object in the HSL color space.
30 |
31 | Parameters: `color` - a color object.
32 |
33 | Returns: `percentage` 0-100
34 |
35 | Example: `lightness(hsl(90, 100%, 50%))`
36 |
37 | Output: `50%`
38 |
39 |
40 | ### hsvhue
41 |
42 | > Extracts the hue channel of a color object in the HSV color space.
43 |
44 | Parameters: `color` - a color object.
45 |
46 | Returns: `integer` `0-360`
47 |
48 | Example: `hsvhue(hsv(90, 100%, 50%))`
49 |
50 | Output: `90`
51 |
52 |
53 | ### hsvsaturation
54 |
55 | > Extracts the saturation channel of a color object in the HSV color space.
56 |
57 | Parameters: `color` - a color object.
58 |
59 | Returns: `percentage` 0-100
60 |
61 | Example: `hsvsaturation(hsv(90, 100%, 50%))`
62 |
63 | Output: `100%`
64 |
65 |
66 | ### hsvvalue
67 |
68 | > Extracts the value channel of a color object in the HSV color space.
69 |
70 | Parameters: `color` - a color object.
71 |
72 | Returns: `percentage` 0-100
73 |
74 | Example: `hsvvalue(hsv(90, 100%, 50%))`
75 |
76 | Output: `50%`
77 |
78 |
79 | ### red
80 |
81 | > Extracts the red channel of a color object.
82 |
83 | Parameters: `color` - a color object.
84 |
85 | Returns: `float` 0-255
86 |
87 | Example: `red(rgb(10, 20, 30))`
88 |
89 | Output: `10`
90 |
91 |
92 | ### green
93 |
94 | > Extracts the green channel of a color object.
95 |
96 | Parameters: `color` - a color object.
97 |
98 | Returns: `float` 0-255
99 |
100 | Example: `green(rgb(10, 20, 30))`
101 |
102 | Output: `20`
103 |
104 |
105 | ### blue
106 |
107 | > Extracts the blue channel of a color object.
108 |
109 | Parameters: `color` - a color object.
110 |
111 | Returns: `float` 0-255
112 |
113 | Example: `blue(rgb(10, 20, 30))`
114 |
115 | Output: `30`
116 |
117 |
118 | ### alpha
119 |
120 | > Extracts the alpha channel of a color object.
121 |
122 | Parameters: `color` - a color object.
123 |
124 | Returns: `float` 0-1
125 |
126 | Example: `alpha(rgba(10, 20, 30, 0.5))`
127 |
128 | Output: `0.5`
129 |
130 |
131 | ### luma
132 |
133 | > Calculates the [luma](http://en.wikipedia.org/wiki/Luma_%28video%29) (perceptual brightness) of a color object.
134 |
135 | Uses **SMPTE C / Rec. 709** coefficients, as recommended in [WCAG 2.0](http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef). This calculation is also used in the contrast function.
136 |
137 | Before v1.7.0 the luma was calculated without gamma correction, use the luminance function to calculate these "old" values.
138 |
139 | Parameters: `color` - a color object.
140 |
141 | Returns: `percentage` 0-100%
142 |
143 | Example: `luma(rgb(100, 200, 30))`
144 |
145 | Output: `44%`
146 |
147 |
148 | ### luminance
149 |
150 | > Calculates the value of the luma without gamma correction (this function was named `luma` before v1.7.0)
151 |
152 | Parameters: `color` - a color object.
153 |
154 | Returns: `percentage` 0-100%
155 |
156 | Example: `luminance(rgb(100, 200, 30))`
157 |
158 | Output: `65%`
159 |
--------------------------------------------------------------------------------
/styles/bootstrap/modals.less:
--------------------------------------------------------------------------------
1 | //
2 | // Modals
3 | // --------------------------------------------------
4 |
5 | // .modal-open - body class for killing the scroll
6 | // .modal - container to scroll within
7 | // .modal-dialog - positioning shell for the actual modal
8 | // .modal-content - actual modal w/ bg and corners and shit
9 |
10 | // Kill the scroll on the body
11 | .modal-open {
12 | overflow: hidden;
13 | }
14 |
15 | // Container that the modal scrolls within
16 | .modal {
17 | display: none;
18 | overflow: auto;
19 | overflow-y: scroll;
20 | position: fixed;
21 | top: 0;
22 | right: 0;
23 | bottom: 0;
24 | left: 0;
25 | z-index: @zindex-modal-background;
26 |
27 | // When fading in the modal, animate it to slide down
28 | &.fade .modal-dialog {
29 | .translate(0, -25%);
30 | .transition-transform(~"0.3s ease-out");
31 | }
32 | &.in .modal-dialog { .translate(0, 0)}
33 | }
34 |
35 | // Shell div to position the modal with bottom padding
36 | .modal-dialog {
37 | margin-left: auto;
38 | margin-right: auto;
39 | width: auto;
40 | padding: 10px;
41 | z-index: (@zindex-modal-background + 10);
42 | }
43 |
44 | // Actual modal
45 | .modal-content {
46 | position: relative;
47 | background-color: @modal-content-bg;
48 | border: 1px solid @modal-content-fallback-border-color; //old browsers fallback (ie8 etc)
49 | border: 1px solid @modal-content-border-color;
50 | border-radius: @border-radius-large;
51 | .box-shadow(0 3px 9px rgba(0,0,0,.5));
52 | background-clip: padding-box;
53 | // Remove focus outline from opened modal
54 | outline: none;
55 | }
56 |
57 | // Modal background
58 | .modal-backdrop {
59 | position: fixed;
60 | top: 0;
61 | right: 0;
62 | bottom: 0;
63 | left: 0;
64 | z-index: (@zindex-modal-background - 10);
65 | background-color: @modal-backdrop-bg;
66 | // Fade for backdrop
67 | &.fade { .opacity(0); }
68 | &.in { .opacity(.5); }
69 | }
70 |
71 | // Modal header
72 | // Top section of the modal w/ title and dismiss
73 | .modal-header {
74 | padding: @modal-title-padding;
75 | border-bottom: 1px solid @modal-header-border-color;
76 | min-height: (@modal-title-padding + @modal-title-line-height);
77 | }
78 | // Close icon
79 | .modal-header .close {
80 | margin-top: -2px;
81 | }
82 |
83 | // Title text within header
84 | .modal-title {
85 | margin: 0;
86 | line-height: @modal-title-line-height;
87 | }
88 |
89 | // Modal body
90 | // Where all modal content resides (sibling of .modal-header and .modal-footer)
91 | .modal-body {
92 | position: relative;
93 | padding: @modal-inner-padding;
94 | }
95 |
96 | // Footer (for actions)
97 | .modal-footer {
98 | margin-top: 15px;
99 | padding: (@modal-inner-padding - 1) @modal-inner-padding @modal-inner-padding;
100 | text-align: right; // right align buttons
101 | border-top: 1px solid @modal-footer-border-color;
102 | .clearfix(); // clear it in case folks use .pull-* classes on buttons
103 |
104 | // Properly space out buttons
105 | .btn + .btn {
106 | margin-left: 5px;
107 | margin-bottom: 0; // account for input[type="submit"] which gets the bottom margin like all other inputs
108 | }
109 | // but override that for button groups
110 | .btn-group .btn + .btn {
111 | margin-left: -1px;
112 | }
113 | // and override it for block buttons as well
114 | .btn-block + .btn-block {
115 | margin-left: 0;
116 | }
117 | }
118 |
119 | // Scale up the modal
120 | @media screen and (min-width: @screen-sm-min) {
121 |
122 | .modal-dialog {
123 | width: 600px;
124 | padding-top: 30px;
125 | padding-bottom: 30px;
126 | }
127 | .modal-content {
128 | .box-shadow(0 5px 15px rgba(0,0,0,.5));
129 | }
130 |
131 | }
132 |
--------------------------------------------------------------------------------
/data/_utils/utils.js:
--------------------------------------------------------------------------------
1 | const url = require('url');
2 | const file = require('fs-utils');
3 | const origin = require('remote-origin-url');
4 | const branch = require('git-branch');
5 | const repoUrl = require('github-repo-url');
6 | const ghUsername = require('git-username');
7 | const ghRepoName = require('git-repo-name');
8 |
9 |
10 | /**
11 | * Get the current branch for a local git repository
12 | */
13 |
14 | exports.uppercase = function(str) {
15 | return str.toUpperCase();
16 | };
17 |
18 |
19 | /**
20 | * Get the current branch for a local git repository
21 | */
22 |
23 | exports.origin = origin.url;
24 |
25 |
26 | /**
27 | * Get the current branch for a local git repository
28 | */
29 |
30 | exports.branch = function () {
31 | return branch;
32 | };
33 |
34 |
35 | /**
36 | * Get the remote origin url for a local git repository
37 | */
38 |
39 | exports.repo_url = function () {
40 | return repoUrl;
41 | };
42 |
43 |
44 | /**
45 | * Get the username from the GitHub remote origin URL
46 | */
47 |
48 | exports.username = function () {
49 | return ghUsername;
50 | };
51 |
52 |
53 | /**
54 | * Get the repo name from the GitHub remote origin URL
55 | */
56 |
57 | exports.repo_name = function () {
58 | return ghRepoName;
59 | };
60 |
61 |
62 | /**
63 | * Count the number of files returned from the
64 | * given glob pattern.
65 | */
66 |
67 | exports.fileCount = function(str) {
68 | return file.expand(str).length;
69 | };
70 |
71 |
72 | /**
73 | * Get the hostname of a URL
74 | * @param {String} str The full URL to parse
75 | * @return {String} The hostname only
76 | * @example
77 | * <%= _.hostname('https://assemble.io') %>
78 | * => assemble.io
79 | */
80 |
81 | exports.hostname = function(str) {
82 | return url.parse(str).hostname;
83 | };
84 |
85 |
86 | /**
87 | * Strip `.git` from the end of a URL, so the URL
88 | * can be used and extended in config values.
89 | *
90 | * @param {String} str
91 | * @return {String}
92 | * @example
93 | * <%= _.stripGit('https://github.com/assemble/assemble.io.git') %>
94 | * => https://github.com/assemble/assemble.io
95 | */
96 |
97 | exports.stripGit = function(url) {
98 | var git = /\.git$/;
99 | if (git.test(url)) {
100 | return url.replace(git, '');
101 | }
102 | return url;
103 | };
104 |
105 |
106 |
107 |
108 | /**
109 | * Date functions used in _.date() mixin
110 | *
111 | * @name formatDate
112 | * @param {Object} dateobj The date object to format.
113 | * @param {String} structure The structure to use, e.g. 'YYYY-MM-DD'.
114 | *
115 | * @return {String} The formatted date.
116 | * @api public
117 | */
118 |
119 | exports.date = function(structure) {
120 | /* jshint unused: false */
121 |
122 | var dateobj = new Date();
123 |
124 | var year = dateobj.getFullYear();
125 | var month = ('0' + (dateobj.getMonth() + 1)).slice(-2);
126 | var date = ('0' + dateobj.getDate()).slice(-2);
127 | var hours = ('0' + dateobj.getHours()).slice(-2);
128 | var minutes = ('0' + dateobj.getMinutes()).slice(-2);
129 | var seconds = ('0' + dateobj.getSeconds()).slice(-2);
130 | var day = dateobj.getDay();
131 |
132 | var months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
133 | var dates = ['Sunday', 'Monday', 'Tuesday', 'Wendesday', 'Thursday', 'Friday', 'Saturday'];
134 | var output = '';
135 |
136 | structure = structure || 'YYYY-MMM-DD DDD';
137 | switch (structure) {
138 | case 'YYYY-MM-DD':
139 | output = year + '-' + month + '-' + date;
140 | break;
141 | case 'YYYY':
142 | output = year;
143 | break;
144 | case 'full':
145 | output = dates[parseInt(day)] + ', ' + months[parseInt(month) - 1] + ' ' + date + ', ' + year;
146 | break;
147 | }
148 | return output;
149 | };
150 |
--------------------------------------------------------------------------------
/styles/bootstrap/popovers.less:
--------------------------------------------------------------------------------
1 | //
2 | // Popovers
3 | // --------------------------------------------------
4 |
5 |
6 | .popover {
7 | position: absolute;
8 | top: 0;
9 | left: 0;
10 | z-index: @zindex-popover;
11 | display: none;
12 | padding: 1px;
13 | text-align: left; // Reset given new insertion method
14 | background-color: @popover-bg;
15 | background-clip: padding-box;
16 | border: 1px solid @popover-fallback-border-color;
17 | border: 1px solid @popover-border-color;
18 | border-radius: @border-radius-large;
19 | .box-shadow(0 5px 10px rgba(0,0,0,.2));
20 |
21 | // Overrides for proper insertion
22 | white-space: normal;
23 |
24 | // Offset the popover to account for the popover arrow
25 | &.top { margin-top: -10px; }
26 | &.right { margin-left: 10px; }
27 | &.bottom { margin-top: 10px; }
28 | &.left { margin-left: -10px; }
29 | }
30 |
31 | .popover-title {
32 | margin: 0; // reset heading margin
33 | padding: 8px 14px;
34 | font-size: @font-size-base;
35 | font-weight: normal;
36 | line-height: 18px;
37 | background-color: @popover-title-bg;
38 | border-bottom: 1px solid darken(@popover-title-bg, 5%);
39 | border-radius: 5px 5px 0 0;
40 | }
41 |
42 | .popover-content {
43 | padding: 9px 14px;
44 | }
45 |
46 | // Arrows
47 | //
48 | // .arrow is outer, .arrow:after is inner
49 |
50 | .popover .arrow {
51 | &,
52 | &:after {
53 | position: absolute;
54 | display: block;
55 | width: 0;
56 | height: 0;
57 | border-color: transparent;
58 | border-style: solid;
59 | }
60 | }
61 | .popover .arrow {
62 | border-width: @popover-arrow-outer-width;
63 | }
64 | .popover .arrow:after {
65 | border-width: @popover-arrow-width;
66 | content: "";
67 | }
68 |
69 | .popover {
70 | &.top .arrow {
71 | left: 50%;
72 | margin-left: -@popover-arrow-outer-width;
73 | border-bottom-width: 0;
74 | border-top-color: @popover-arrow-outer-fallback-color; // IE8 fallback
75 | border-top-color: @popover-arrow-outer-color;
76 | bottom: -@popover-arrow-outer-width;
77 | &:after {
78 | content: " ";
79 | bottom: 1px;
80 | margin-left: -@popover-arrow-width;
81 | border-bottom-width: 0;
82 | border-top-color: @popover-arrow-color;
83 | }
84 | }
85 | &.right .arrow {
86 | top: 50%;
87 | left: -@popover-arrow-outer-width;
88 | margin-top: -@popover-arrow-outer-width;
89 | border-left-width: 0;
90 | border-right-color: @popover-arrow-outer-fallback-color; // IE8 fallback
91 | border-right-color: @popover-arrow-outer-color;
92 | &:after {
93 | content: " ";
94 | left: 1px;
95 | bottom: -@popover-arrow-width;
96 | border-left-width: 0;
97 | border-right-color: @popover-arrow-color;
98 | }
99 | }
100 | &.bottom .arrow {
101 | left: 50%;
102 | margin-left: -@popover-arrow-outer-width;
103 | border-top-width: 0;
104 | border-bottom-color: @popover-arrow-outer-fallback-color; // IE8 fallback
105 | border-bottom-color: @popover-arrow-outer-color;
106 | top: -@popover-arrow-outer-width;
107 | &:after {
108 | content: " ";
109 | top: 1px;
110 | margin-left: -@popover-arrow-width;
111 | border-top-width: 0;
112 | border-bottom-color: @popover-arrow-color;
113 | }
114 | }
115 |
116 | &.left .arrow {
117 | top: 50%;
118 | right: -@popover-arrow-outer-width;
119 | margin-top: -@popover-arrow-outer-width;
120 | border-right-width: 0;
121 | border-left-color: @popover-arrow-outer-fallback-color; // IE8 fallback
122 | border-left-color: @popover-arrow-outer-color;
123 | &:after {
124 | content: " ";
125 | right: 1px;
126 | border-right-width: 0;
127 | border-left-color: @popover-arrow-color;
128 | bottom: -@popover-arrow-width;
129 | }
130 | }
131 |
132 | }
133 |
--------------------------------------------------------------------------------
/styles/bootstrap/input-groups.less:
--------------------------------------------------------------------------------
1 | //
2 | // Input groups
3 | // --------------------------------------------------
4 |
5 | // Base styles
6 | // -------------------------
7 | .input-group {
8 | position: relative; // For dropdowns
9 | display: table;
10 | border-collapse: separate; // prevent input groups from inheriting border styles from table cells when placed within a table
11 |
12 | // Undo padding and float of grid classes
13 | &.col {
14 | float: none;
15 | padding-left: 0;
16 | padding-right: 0;
17 | }
18 |
19 | .form-control {
20 | width: 100%;
21 | margin-bottom: 0;
22 | }
23 | }
24 |
25 | // Sizing options
26 | //
27 | // Remix the default form control sizing classes into new ones for easier
28 | // manipulation.
29 |
30 | .input-group-lg > .form-control,
31 | .input-group-lg > .input-group-addon,
32 | .input-group-lg > .input-group-btn > .btn { .input-lg(); }
33 | .input-group-sm > .form-control,
34 | .input-group-sm > .input-group-addon,
35 | .input-group-sm > .input-group-btn > .btn { .input-sm(); }
36 |
37 |
38 | // Display as table-cell
39 | // -------------------------
40 | .input-group-addon,
41 | .input-group-btn,
42 | .input-group .form-control {
43 | display: table-cell;
44 |
45 | &:not(:first-child):not(:last-child) {
46 | border-radius: 0;
47 | }
48 | }
49 | // Addon and addon wrapper for buttons
50 | .input-group-addon,
51 | .input-group-btn {
52 | width: 1%;
53 | white-space: nowrap;
54 | vertical-align: middle; // Match the inputs
55 | }
56 |
57 | // Text input groups
58 | // -------------------------
59 | .input-group-addon {
60 | padding: @padding-base-vertical @padding-base-horizontal;
61 | font-size: @font-size-base;
62 | font-weight: normal;
63 | line-height: 1;
64 | color: @input-color;
65 | text-align: center;
66 | background-color: @input-group-addon-bg;
67 | border: 1px solid @input-group-addon-border-color;
68 | border-radius: @border-radius-base;
69 |
70 | // Sizing
71 | &.input-sm {
72 | padding: @padding-small-vertical @padding-small-horizontal;
73 | font-size: @font-size-small;
74 | border-radius: @border-radius-small;
75 | }
76 | &.input-lg {
77 | padding: @padding-large-vertical @padding-large-horizontal;
78 | font-size: @font-size-large;
79 | border-radius: @border-radius-large;
80 | }
81 |
82 | // Nuke default margins from checkboxes and radios to vertically center within.
83 | input[type="radio"],
84 | input[type="checkbox"] {
85 | margin-top: 0;
86 | }
87 | }
88 |
89 | // Reset rounded corners
90 | .input-group .form-control:first-child,
91 | .input-group-addon:first-child,
92 | .input-group-btn:first-child > .btn,
93 | .input-group-btn:first-child > .dropdown-toggle,
94 | .input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle) {
95 | .border-right-radius(0);
96 | }
97 | .input-group-addon:first-child {
98 | border-right: 0;
99 | }
100 | .input-group .form-control:last-child,
101 | .input-group-addon:last-child,
102 | .input-group-btn:last-child > .btn,
103 | .input-group-btn:last-child > .dropdown-toggle,
104 | .input-group-btn:first-child > .btn:not(:first-child) {
105 | .border-left-radius(0);
106 | }
107 | .input-group-addon:last-child {
108 | border-left: 0;
109 | }
110 |
111 | // Button input groups
112 | // -------------------------
113 | .input-group-btn {
114 | position: relative;
115 | white-space: nowrap;
116 |
117 | // Negative margin to only have a 1px border between the two
118 | &:first-child > .btn {
119 | margin-right: -1px;
120 | }
121 | &:last-child > .btn {
122 | margin-left: -1px;
123 | }
124 | }
125 | .input-group-btn > .btn {
126 | position: relative;
127 | // Jankily prevent input button groups from wrapping
128 | + .btn {
129 | margin-left: -4px;
130 | }
131 | // Bring the "active" button to the front
132 | &:hover,
133 | &:active {
134 | z-index: 2;
135 | }
136 | }
137 |
--------------------------------------------------------------------------------
/data/less.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "less",
3 | "version": "4.1.3",
4 | "description": "Leaner CSS",
5 | "homepage": "http://lesscss.org",
6 | "author": {
7 | "name": "Alexis Sellier",
8 | "email": "self@cloudhead.net"
9 | },
10 | "contributors": [
11 | "The Core Less Team"
12 | ],
13 | "bugs": {
14 | "url": "https://github.com/less/less.js/issues"
15 | },
16 | "repository": {
17 | "type": "git",
18 | "url": "https://github.com/less/less.js.git"
19 | },
20 | "master": {
21 | "url": "https://github.com/less/less.js/blob/master/",
22 | "raw": "https://raw.githubusercontent.com/less/less.js/master/"
23 | },
24 | "license": "Apache-2.0",
25 | "bin": {
26 | "lessc": "./bin/lessc"
27 | },
28 | "main": "index",
29 | "module": "./lib/less-node/index",
30 | "directories": {
31 | "test": "./test"
32 | },
33 | "browser": "./dist/less.js",
34 | "engines": {
35 | "node": ">=6"
36 | },
37 | "scripts": {
38 | "test": "grunt test",
39 | "grunt": "grunt",
40 | "lint": "eslint '**/*.{ts,js}'",
41 | "lint:fix": "eslint '**/*.{ts,js}' --fix",
42 | "build": "npm-run-all clean compile",
43 | "clean": "shx rm -rf ./lib tsconfig.tsbuildinfo",
44 | "compile": "tsc -p tsconfig.build.json",
45 | "copy:root": "shx cp -rf ./dist ../../",
46 | "dev": "tsc -p tsconfig.build.json -w",
47 | "prepublishOnly": "grunt dist"
48 | },
49 | "optionalDependencies": {
50 | "errno": "^0.1.1",
51 | "graceful-fs": "^4.1.2",
52 | "image-size": "~0.5.0",
53 | "make-dir": "^2.1.0",
54 | "mime": "^1.4.1",
55 | "needle": "^3.1.0",
56 | "source-map": "~0.6.0"
57 | },
58 | "devDependencies": {
59 | "@less/test-data": "^4.1.0",
60 | "@less/test-import-module": "^4.0.0",
61 | "@rollup/plugin-commonjs": "^17.0.0",
62 | "@rollup/plugin-json": "^4.1.0",
63 | "@rollup/plugin-node-resolve": "^11.0.0",
64 | "@typescript-eslint/eslint-plugin": "^4.28.0",
65 | "@typescript-eslint/parser": "^4.28.0",
66 | "benny": "^3.6.12",
67 | "bootstrap-less-port": "0.3.0",
68 | "chai": "^4.2.0",
69 | "cross-env": "^7.0.3",
70 | "diff": "^3.2.0",
71 | "eslint": "^7.29.0",
72 | "fs-extra": "^8.1.0",
73 | "git-rev": "^0.2.1",
74 | "globby": "^10.0.1",
75 | "grunt": "^1.0.4",
76 | "grunt-cli": "^1.3.2",
77 | "grunt-contrib-clean": "^1.0.0",
78 | "grunt-contrib-connect": "^1.0.2",
79 | "grunt-eslint": "^23.0.0",
80 | "grunt-saucelabs": "^9.0.1",
81 | "grunt-shell": "^1.3.0",
82 | "html-template-tag": "^3.2.0",
83 | "jit-grunt": "^0.10.0",
84 | "less-plugin-autoprefix": "^1.5.1",
85 | "less-plugin-clean-css": "^1.5.1",
86 | "minimist": "^1.2.0",
87 | "mocha": "^6.2.1",
88 | "mocha-headless-chrome": "^4.0.0",
89 | "mocha-teamcity-reporter": "^3.0.0",
90 | "nock": "^11.8.2",
91 | "npm-run-all": "^4.1.5",
92 | "performance-now": "^0.2.0",
93 | "phin": "^2.2.3",
94 | "promise": "^7.1.1",
95 | "read-glob": "^3.0.0",
96 | "resolve": "^1.17.0",
97 | "rollup": "^2.52.2",
98 | "rollup-plugin-terser": "^5.1.1",
99 | "rollup-plugin-typescript2": "^0.29.0",
100 | "semver": "^6.3.0",
101 | "shx": "^0.3.2",
102 | "time-grunt": "^1.3.0",
103 | "ts-node": "^9.1.1",
104 | "typescript": "^4.3.4",
105 | "uikit": "2.27.4"
106 | },
107 | "keywords": [
108 | "compile less",
109 | "css nesting",
110 | "css variable",
111 | "css",
112 | "gradients css",
113 | "gradients css3",
114 | "less compiler",
115 | "less css",
116 | "less mixins",
117 | "less",
118 | "less.js",
119 | "lesscss",
120 | "mixins",
121 | "nested css",
122 | "parser",
123 | "preprocessor",
124 | "bootstrap css",
125 | "bootstrap less",
126 | "style",
127 | "styles",
128 | "stylesheet",
129 | "variables in css",
130 | "css less"
131 | ],
132 | "rawcurrent": "https://raw.github.com/less/less.js/v",
133 | "sourcearchive": "https://github.com/less/less.js/archive/v",
134 | "dependencies": {
135 | "copy-anything": "^2.0.1",
136 | "parse-node-version": "^1.0.1",
137 | "tslib": "^2.3.0"
138 | }
139 | }
140 |
--------------------------------------------------------------------------------
/templates/includes/nav-main.hbs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
12 |
13 | {{#is slug 'index'}}
14 |
15 | Overview
16 |
17 | {{else}}
18 |
19 | Overview
20 |
21 | {{/is}}
22 |
23 | {{#is slug 'usage'}}
24 |
25 | Using Less.js
26 |
27 | {{else}}
28 |
29 | Using Less.js
30 |
31 | {{/is}}
32 |
33 | {{#is slug 'functions'}}
34 |
35 | Functions
36 |
37 | {{else}}
38 |
39 | Functions
40 |
41 | {{/is}}
42 |
43 | {{#is slug 'features'}}
44 |
45 | In-Depth Guide
46 |
47 | {{else}}
48 |
49 | In-Depth Guide
50 |
51 | {{/is}}
52 |
53 | {{#is links.plugins true}}
54 | {{#is slug 'plugins'}}
55 |
56 | Plugins
57 |
58 | {{else}}
59 |
60 | Plugins
61 |
62 | {{/is}}
63 | {{/is}}
64 |
65 | {{#is slug 'tools'}}
66 |
67 | Tools
68 |
69 | {{else}}
70 |
71 | Tools
72 |
73 | {{/is}}
74 |
75 | {{#is slug 'about'}}
76 |
77 | About
78 |
79 | {{else}}
80 |
81 | About
82 |
83 | {{/is}}
84 |
85 | {{#is links.cheatsheet true}}
86 | {{#is slug 'cheatsheet'}}
87 |
88 | Cheatsheet
89 |
90 | {{else}}
91 |
92 | Cheatsheet
93 |
94 | {{/is}}
95 | {{/is}}
96 |
97 |
98 | {{#is links.blog true}}
99 | {{#is slug 'blog'}}
100 |
101 | Blog
102 |
103 | {{else}}
104 |
105 | Blog
106 |
107 | {{/is}}
108 | {{/is}}
109 |
110 |
111 |
114 |
115 |
116 |
117 | GitHub
118 |
125 |
126 |
127 |
128 |
129 |
130 |
--------------------------------------------------------------------------------
/content/features/mixins.md:
--------------------------------------------------------------------------------
1 | > "mix-in" properties from existing styles
2 |
3 | You can mix-in class selectors and id selectors, e.g.
4 |
5 | ```less
6 | .a, #b {
7 | color: red;
8 | }
9 | .mixin-class {
10 | .a();
11 | }
12 | .mixin-id {
13 | #b();
14 | }
15 | ```
16 | which results in:
17 | ```css
18 | .a, #b {
19 | color: red;
20 | }
21 | .mixin-class {
22 | color: red;
23 | }
24 | .mixin-id {
25 | color: red;
26 | }
27 | ```
28 |
29 | Historically, the parentheses in a mixin call are optional, but optional parentheses are deprecated and will be required in a future release.
30 |
31 | ```less
32 | .a();
33 | .a; // currently works, but deprecated; don't use
34 | .a (); // white-space before parentheses is also deprecated
35 | ```
36 |
37 | ## Mixins With Parentheses
38 |
39 | If you want to create a mixin but you do not want that mixin to be in your CSS output, put parentheses after the mixin definition.
40 |
41 | ```less
42 | .my-mixin {
43 | color: black;
44 | }
45 | .my-other-mixin() {
46 | background: white;
47 | }
48 | .class {
49 | .my-mixin();
50 | .my-other-mixin();
51 | }
52 | ```
53 | outputs
54 |
55 | ```css
56 | .my-mixin {
57 | color: black;
58 | }
59 | .class {
60 | color: black;
61 | background: white;
62 | }
63 | ```
64 |
65 | ## Selectors in Mixins
66 |
67 | Mixins can contain more than just properties, they can contain selectors too.
68 |
69 | For example:
70 |
71 | ```less
72 | .my-hover-mixin() {
73 | &:hover {
74 | border: 1px solid red;
75 | }
76 | }
77 | button {
78 | .my-hover-mixin();
79 | }
80 | ```
81 |
82 | Outputs
83 |
84 | ```css
85 | button:hover {
86 | border: 1px solid red;
87 | }
88 | ```
89 |
90 | ## Namespaces
91 |
92 | If you want to mixin properties inside a more complicated selector, you can stack up multiple ids or classes.
93 |
94 | ```less
95 | #outer() {
96 | .inner {
97 | color: red;
98 | }
99 | }
100 |
101 | .c {
102 | #outer.inner();
103 | }
104 | ```
105 |
106 | Note: legacy Less syntax allows `>` and whitespace between namespaces and mixins. This syntax is deprecated and may be removed. Currently, these do the same thing.
107 |
108 | ```less
109 | #outer > .inner(); // deprecated
110 | #outer .inner(); // deprecated
111 | #outer.inner(); // preferred
112 | ```
113 |
114 | Namespacing your mixins like this reduces conflicts with other library mixins or user mixins, but can also be a way to "organize" groups of mixins.
115 |
116 | Example:
117 |
118 | ```less
119 | #my-library {
120 | .my-mixin() {
121 | color: black;
122 | }
123 | }
124 | // which can be used like this
125 | .class {
126 | #my-library.my-mixin();
127 | }
128 | ```
129 |
130 | ## Guarded Namespaces
131 |
132 | If a namespace has a guard, mixins defined by it are used only if the guard condition returns true. A namespace guard is evaluated exactly the same as a guard on a mixin, so the following two mixins work the same way:
133 |
134 | ```less
135 | #namespace when (@mode = huge) {
136 | .mixin() { /* */ }
137 | }
138 |
139 | #namespace {
140 | .mixin() when (@mode = huge) { /* */ }
141 | }
142 | ```
143 |
144 | The `default` function is assumed to have the same value for all nested namespaces and mixin. The following mixin is never evaluated; one of its guards is guaranteed to be false:
145 |
146 | ```less
147 | #sp_1 when (default()) {
148 | #sp_2 when (default()) {
149 | .mixin() when not(default()) { /* */ }
150 | }
151 | }
152 | ```
153 |
154 | ## The `!important` keyword
155 |
156 | Use the `!important` keyword after mixin call to mark all properties inherited by it as `!important`:
157 |
158 | Example:
159 |
160 | ```less
161 | .foo (@bg: #f5f5f5, @color: #900) {
162 | background: @bg;
163 | color: @color;
164 | }
165 | .unimportant {
166 | .foo();
167 | }
168 | .important {
169 | .foo() !important;
170 | }
171 | ```
172 |
173 | Results in:
174 |
175 | ```css
176 | .unimportant {
177 | background: #f5f5f5;
178 | color: #900;
179 | }
180 | .important {
181 | background: #f5f5f5 !important;
182 | color: #900 !important;
183 | }
184 | ```
185 |
--------------------------------------------------------------------------------
/styles/components/ad.less:
--------------------------------------------------------------------------------
1 | //
2 | // Ads
3 | // --------------------------------------------------
4 |
5 | #carbonads {
6 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu,
7 | Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif;
8 | }
9 |
10 | #carbonads {
11 | display: flex;
12 | max-width: 330px;
13 | background-color: hsl(0, 0%, 98%);
14 | box-shadow: 0 1px 4px 1px rgba(0, 0, 0, 0.2);
15 | margin: 1em;
16 | }
17 |
18 | #carbonads a {
19 | color: inherit;
20 | text-decoration: none;
21 | }
22 |
23 | #carbonads a:hover {
24 | color: inherit;
25 | }
26 |
27 | #carbonads span {
28 | position: relative;
29 | display: block;
30 | overflow: hidden;
31 | }
32 |
33 | #carbonads .carbon-wrap {
34 | display: flex;
35 | }
36 |
37 | .carbon-img {
38 | display: block;
39 | margin: 0;
40 | line-height: 1;
41 | }
42 |
43 | .carbon-img img {
44 | display: block;
45 | }
46 |
47 | .carbon-text {
48 | font-size: 13px;
49 | padding: 10px;
50 | line-height: 1.5;
51 | text-align: left;
52 | }
53 |
54 | .carbon-poweredby {
55 | display: block;
56 | padding: 8px 10px;
57 | background: repeating-linear-gradient(-45deg, transparent, transparent 5px, hsla(0, 0%, 0%, .025) 5px, hsla(0, 0%, 0%, .025) 10px) hsla(203, 11%, 95%, .4);
58 | text-align: center;
59 | text-transform: uppercase;
60 | letter-spacing: .5px;
61 | font-weight: 600;
62 | font-size: 9px;
63 | line-height: 1;
64 | }
65 |
66 | /*
67 | * Advertisement that shows on all pages (except homepage) in page headers.
68 | * `!important` is required for any pre-set property.
69 | */
70 | .ad {
71 | width: auto !important;
72 | margin: 50px -30px -40px !important;
73 | padding: 20px !important;
74 | overflow: hidden; /* clearfix */
75 | height: auto !important;
76 | font-size: 13px !important;
77 | line-height: 16px !important;
78 | text-align: left;
79 | background: darken(@navbar-inverse-bg, 5%) !important;
80 | border: 0 !important;
81 | box-shadow: inset 0 3px 5px rgba(0,0,0,.075);
82 | }
83 | .ad-img {
84 | margin: 0 !important;
85 | }
86 | .ad-text,
87 | .ad-tag {
88 | float: none !important;
89 | display: block !important;
90 | width: auto !important;
91 | height: auto !important;
92 | margin-left: 145px !important;
93 | font-family: "Helvetica Neue", Helvetica, Arial, sans-serif !important;
94 | }
95 | .ad-text {
96 | padding-top: 0 !important;
97 | }
98 | .ad-tag {
99 | color: @navbar-inverse-color !important;
100 | text-align: left !important;
101 | }
102 | .ad-text a,
103 | .ad-tag a {
104 | color: #fff !important;
105 | }
106 | .ad #adsense > img {
107 | display: none; /* hide what I assume are tracking images */
108 | }
109 |
110 | @media (min-width: 768px) {
111 | .ad {
112 | margin: 0 !important;
113 | border-radius: 4px;
114 | box-shadow: inset 0 3px 5px rgba(0,0,0,.075), 0 1px 0 rgba(255,255,255,.1);
115 | }
116 | }
117 |
118 | @media (min-width: 992px) {
119 | .ad {
120 | position: absolute;
121 | top: 20px;
122 | right: 15px; /* 15px instead of 0 since box-sizing */
123 | padding: 15px !important;
124 | width: 330px !important;
125 | }
126 | }
127 |
128 | /* Homepage variations */
129 | .docs-home .ad {
130 | margin: 0 -15px 40px !important;
131 | }
132 | @media (min-width: 480px) {
133 | .docs-home .ad {
134 | width: 330px !important;
135 | margin: 0 auto 40px !important;
136 | border-radius: 4px;
137 | }
138 | }
139 | @media (min-width: 768px) {
140 | .docs-home .ad {
141 | float: left;
142 | width: 330px !important;
143 | margin: 0 0 30px !important;
144 | }
145 | .docs-home .bs-social,
146 | .docs-home .bs-masthead-links {
147 | margin-left: 350px;
148 | }
149 | .docs-home .bs-social {
150 | margin-bottom: 10px;
151 | }
152 | .docs-home .bs-masthead-links {
153 | margin-top: 10px;
154 | }
155 | }
156 | @media (min-width: 992px) {
157 | .docs-home .ad {
158 | position: static;
159 | }
160 | }
161 | @media (min-width: 1170px) {
162 | .docs-home .ad {
163 | margin-top: -25px !important;
164 | }
165 | }
166 |
--------------------------------------------------------------------------------
/content/features/mixins-as-functions.md:
--------------------------------------------------------------------------------
1 | > Selecting properties and variables from mixin calls
2 |
3 | #### Property / value accessors
4 |
5 | _Released [v3.5.0]({{ less.master.url }}CHANGELOG.md)_
6 |
7 | Starting in Less 3.5, you can use property/variable accessors to select a value from an evaluated mixin's rules. This can allow you to use mixins similar to functions.
8 |
9 | Example:
10 |
11 | ```less
12 | .average(@x, @y) {
13 | @result: ((@x + @y) / 2);
14 | }
15 |
16 | div {
17 | // call a mixin and look up its "@result" value
18 | padding: .average(16px, 50px)[@result];
19 | }
20 | ```
21 |
22 | Results in:
23 |
24 | ```css
25 | div {
26 | padding: 33px;
27 | }
28 | ```
29 |
30 | #### Overriding mixin values
31 |
32 | If you have multiple matching mixins, all rules are evaluated and merged, and the last matching value with that identifier is returned. This is similar to the cascade in CSS, and it allows you to "override" mixin values.
33 |
34 | ```less
35 | // library.less
36 | #library() {
37 | .mixin() {
38 | prop: foo;
39 | }
40 | }
41 |
42 | // customize.less
43 | @import "library";
44 | #library() {
45 | .mixin() {
46 | prop: bar;
47 | }
48 | }
49 |
50 | .box {
51 | my-value: #library.mixin[prop];
52 | }
53 | ```
54 | Outputs:
55 | ```css
56 | .box {
57 | my-value: bar;
58 | }
59 | ```
60 |
61 | #### Unnamed lookups
62 |
63 | If you don't specify a lookup value in `[@lookup]` and instead write `[]` after a mixin or ruleset call, _all_ values will cascade and the last declared value will be selected.
64 |
65 | Meaning: the averaging mixin from the above example could be written as:
66 | ```less
67 | .average(@x, @y) {
68 | @result: ((@x + @y) / 2);
69 | }
70 |
71 | div {
72 | // call a mixin and look up its final value
73 | padding: .average(16px, 50px)[];
74 | }
75 | ```
76 | The output is the same:
77 | ```css
78 | div {
79 | padding: 33px;
80 | }
81 | ```
82 |
83 | The same cascading behavior is true for rulesets or variables aliased to mixin calls.
84 | ```less
85 | @dr: {
86 | value: foo;
87 | }
88 | .box {
89 | my-value: @dr[];
90 | }
91 | ```
92 | This outputs:
93 | ```css
94 | .box {
95 | my-value: foo;
96 | }
97 | ```
98 |
99 |
100 | #### Unlocking mixins & variables into caller scope
101 |
102 | ***DEPRECATED - Use Property / Value Accessors***
103 |
104 | Variables and mixins defined in a mixin are visible and can be used in caller's scope. There is only one exception: a variable is not copied if the caller contains a variable with the same name (that includes variables defined by another mixin call). Only variables present in callers local scope are protected. Variables inherited from parent scopes are overridden.
105 |
106 | _Note: this behavior is deprecated, and in the future, variables and mixins will not be merged into the caller scope in this way._
107 |
108 | Example:
109 |
110 | ```less
111 | .mixin() {
112 | @width: 100%;
113 | @height: 200px;
114 | }
115 |
116 | .caller {
117 | .mixin();
118 | width: @width;
119 | height: @height;
120 | }
121 |
122 | ```
123 | Results in:
124 |
125 | ```css
126 | .caller {
127 | width: 100%;
128 | height: 200px;
129 | }
130 | ```
131 |
132 | Variables defined directly in callers scope cannot be overridden. However, variables defined in callers parent scope is not protected and will be overridden:
133 | ````less
134 | .mixin() {
135 | @size: in-mixin;
136 | @definedOnlyInMixin: in-mixin;
137 | }
138 |
139 | .class {
140 | margin: @size @definedOnlyInMixin;
141 | .mixin();
142 | }
143 |
144 | @size: globaly-defined-value; // callers parent scope - no protection
145 | ````
146 |
147 | Results in:
148 | ````css
149 | .class {
150 | margin: in-mixin in-mixin;
151 | }
152 | ````
153 |
154 | Finally, mixin defined in mixin acts as return value too:
155 | ````less
156 | .unlock(@value) { // outer mixin
157 | .doSomething() { // nested mixin
158 | declaration: @value;
159 | }
160 | }
161 |
162 | #namespace {
163 | .unlock(5); // unlock doSomething mixin
164 | .doSomething(); //nested mixin was copied here and is usable
165 | }
166 | ````
167 |
168 | Results in:
169 | ````css
170 | #namespace {
171 | declaration: 5;
172 | }
173 | ````
174 |
--------------------------------------------------------------------------------