Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bootstrap
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
bootstrap
Commits
b5d7a51b
Commit
b5d7a51b
authored
Oct 14, 2013
by
Chris Rebert
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #10779 from ssorallen/customizer-bootstrap-less-order
Use bootstrap.less file order in Customizer
parents
4e180893
3663e370
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
11 deletions
+37
-11
docs-assets/js/customizer.js
docs-assets/js/customizer.js
+37
-11
No files found.
docs-assets/js/customizer.js
View file @
b5d7a51b
...
@@ -159,10 +159,32 @@ window.onload = function () { // wait for load in a dumb way because B-0
...
@@ -159,10 +159,32 @@ window.onload = function () { // wait for load in a dumb way because B-0
}
}
}
}
// Returns an Array of @import'd filenames from 'bootstrap.less' in the order
// in which they appear in the file.
function
bootstrapLessFilenames
()
{
var
IMPORT_REGEX
=
/^@import
\"(
.*
?)\"
;$/
var
bootstrapLessLines
=
__less
[
'
bootstrap.less
'
].
split
(
'
\n
'
)
for
(
var
i
=
0
,
imports
=
[];
i
<
bootstrapLessLines
.
length
;
i
++
)
{
var
match
=
IMPORT_REGEX
.
exec
(
bootstrapLessLines
[
i
])
if
(
match
)
imports
.
push
(
match
[
1
])
}
return
imports
}
function
generateCSS
()
{
function
generateCSS
()
{
var
$checked
=
$
(
'
#less-section input:checked
'
)
var
oneChecked
=
false
var
lessFileIncludes
=
{}
$
(
'
#less-section input
'
).
each
(
function
()
{
var
$this
=
$
(
this
)
var
checked
=
$this
.
is
(
'
:checked
'
)
lessFileIncludes
[
$this
.
val
()]
=
checked
oneChecked
=
oneChecked
||
checked
})
if
(
!
$checked
.
length
)
return
false
if
(
!
oneChecked
)
return
false
var
result
=
{}
var
result
=
{}
var
vars
=
{}
var
vars
=
{}
...
@@ -173,15 +195,19 @@ window.onload = function () { // wait for load in a dumb way because B-0
...
@@ -173,15 +195,19 @@ window.onload = function () { // wait for load in a dumb way because B-0
$
(
this
).
val
()
&&
(
vars
[
$
(
this
).
prev
().
text
()
]
=
$
(
this
).
val
())
$
(
this
).
val
()
&&
(
vars
[
$
(
this
).
prev
().
text
()
]
=
$
(
this
).
val
())
})
})
css
+=
__less
[
'
variables.less
'
]
$
.
each
(
bootstrapLessFilenames
(),
function
(
index
,
filename
)
{
if
(
vars
)
css
+=
generateCustomCSS
(
vars
)
var
fileInclude
=
lessFileIncludes
[
filename
]
css
+=
__less
[
'
mixins.less
'
]
css
+=
__less
[
'
normalize.less
'
]
// Files not explicitly unchecked are compiled into the final stylesheet.
css
+=
__less
[
'
scaffolding.less
'
]
// Core stylesheets like 'normalize.less' are not included in the form
css
+=
$checked
// since disabling them would wreck everything, and so their 'fileInclude'
.
map
(
function
()
{
return
__less
[
this
.
value
]
})
// will be 'undefined'.
.
toArray
()
if
(
fileInclude
||
(
fileInclude
==
null
))
css
+=
__less
[
filename
]
.
join
(
'
\n
'
)
// Custom variables are added after Bootstrap variables so the custom
// ones take precedence.
if
((
'
variables.less
'
===
filename
)
&&
vars
)
css
+=
generateCustomCSS
(
vars
)
})
css
=
css
.
replace
(
/@import
[^\n]
*/gi
,
''
)
//strip any imports
css
=
css
.
replace
(
/@import
[^\n]
*/gi
,
''
)
//strip any imports
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment