How to use Twitter Bootstrap 2 with play framework 2.x

前端 未结 8 1415
感动是毒
感动是毒 2020-12-04 08:11

I know that current Play! distribution has a helper for Bootstrap 1.4. What should I do if I want to use the current version of Bootstrap?

8条回答
  •  庸人自扰
    2020-12-04 08:55

    SCRIPT METHOD (from here)

    1- Copy bootstrap’s less files into app/assets/stylesheets/bootstrap

    2- Run this script in app/assets/stylesheets/bootstrap by copying and pasting it in a shell/terminal (the script will rename the partial files and edit the path of the imports):

    for a in *.less; do mv $a _$a; done 
    sed -i 's|@import "|@import "bootstrap/_|' _bootstrap.less 
    mv _bootstrap.less ../bootstrap.less
    sed -i 's|@import "|@import "bootstrap/_|' _responsive.less 
    mv _responsive.less ../responsive.less
    

    Notice: the above script doesn't work on Mac! On Mac use this:

    for a in *.less; do mv $a _$a; done 
    sed -i "" 's|@import "|@import "bootstrap/_|' _bootstrap.less
    mv _bootstrap.less ../bootstrap.less
    sed -i "" 's|@import "|@import "bootstrap/_|' _responsive.less 
    mv _responsive.less ../responsive.less
    

    3- Include the compiled CSS

    
    
    

提交回复
热议问题