Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Y
yii2bootstrap
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
夏彬
yii2bootstrap
Commits
bc49841c
Commit
bc49841c
authored
Feb 14, 2018
by
Klimov Paul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs for asset setup from 'sass' added
parent
30eee2b6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
0 deletions
+54
-0
assets-setup.md
docs/guide/assets-setup.md
+54
-0
No files found.
docs/guide/assets-setup.md
View file @
bc49841c
...
@@ -185,3 +185,57 @@ return [
...
@@ -185,3 +185,57 @@ return [
// ...
// ...
];
];
```
```
## Compiling from the .sass files
If you want to customize the Bootstrap CSS source directly, you may want to compile it from source
*
.sass files.
These can be obtained from
[
Bootstrap ported from Less to Sass
](
https://github.com/twbs/bootstrap-sass
)
.
In such case installing Bootstrap assets from Composer or Bower/NPM makes no sense, since you can not modify files
inside 'vendor' directory.
You'll have to downloaded Bootstrap assets manually and place them somewhere inside you project source code,
for example at 'assets/source/bootstrap' folder.
In the
`composer.json`
of your project, add the following lines in order to prevent redundant Bootstrap asset installation:
```
json
"replace"
:
{
"bower-asset/bootstrap"
:
">=3.3.0"
},
```
Configure 'assetManager' application component, overriding Bootstrap assent bundles and specifying compiler for CSS files:
```
php
return
[
'components'
=>
[
'assetManager'
=>
[
// setup asset converter for *.sass files :
'converter'
=>
[
'class'
=>
'yii\web\AssetConverter'
,
'commands'
=>
[
'scss'
=>
[
'css'
,
'sass {from} {to} --sourcemap'
]
],
],
// override bundles to use local project files :
'bundles'
=>
[
'yii\bootstrap\BootstrapAsset'
=>
[
'sourcePath'
=>
'@app/assets/source/bootstrap'
,
'css'
=>
[
'css/bootstrap.scss'
],
],
'yii\bootstrap\BootstrapPluginAsset'
=>
[
'sourcePath'
=>
'@app/assets/source/bootstrap'
,
],
'yii\bootstrap\BootstrapThemeAsset'
=>
[
'sourcePath'
=>
'@app/assets/source/bootstrap'
,
],
],
],
// ...
],
// ...
];
```
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