SimpLESS won't compile initializr generated Bootstrap

前端 未结 2 1418
不知归路
不知归路 2020-12-19 14:20

I just downloaded an intializr generated version of Bootstrap. I also installed SimpLESS to keep from having to constantly having to manually recompile my LESS files and to

相关标签:
2条回答
  • 2020-12-19 15:03

    I didn't try very long with SimpleLESS, doesn't seem to compile bootstrap at all.

    You could try using the JavaScript provided by lesscss.org or maybe a php less compiler (I haven't tried this one).

    Here is an example of a very basic compiler if you want to compile only from time to time. http://pastebin.com/vXXFdvnk

    Otherwise check the lesscss.org propositions.

    0 讨论(0)
  • 2020-12-19 15:07

    I experienced the same issue, and the workaround for me was to not have nested @imports. I'm using SimpLESS 1.4 and Bootstrap 2.1.0 on Win7 and it works if your style.less file looks like this:

    // CSS Reset
    @import "reset.less";
    
    // Core variables and mixins
    @import "variables.less"; // Modify this for custom colors, font-sizes, etc
    @import "mixins.less";
    
    // Grid system and page structure
    @import "scaffolding.less";
    @import "grid.less";
    @import "layouts.less";
    
    // Base CSS
    @import "type.less";
    @import "code.less";
    @import "forms.less";
    @import "tables.less";
    
    // Components: common
    @import "sprites.less";
    @import "dropdowns.less";
    @import "wells.less";
    @import "component-animations.less";
    @import "close.less";
    
    // Components: Buttons & Alerts
    @import "buttons.less";
    @import "button-groups.less";
    @import "alerts.less"; // Note: alerts share common CSS with buttons and thus have styles in buttons.less
    
    // Components: Nav
    @import "navs.less";
    @import "navbar.less";
    @import "breadcrumbs.less";
    @import "pagination.less";
    @import "pager.less";
    
    // Components: Popovers
    @import "modals.less";
    @import "tooltip.less";
    @import "popovers.less";
    
    // Components: Misc
    @import "thumbnails.less";
    @import "labels-badges.less";
    @import "progress-bars.less";
    @import "accordion.less";
    @import "bootstrap/carousel.less";
    @import "bootstrap/hero-unit.less";
    
    // Utility classes
    @import "utilities.less"; // Has to be last to override when necessary
    
    
    //Needed if using fixed navbar 
    body {
      padding-top: 60px;
      padding-bottom: 40px;
    }
    .sidebar-nav {
      padding: 9px 0;
    }
    
    // RESPONSIVE CLASSES
    // ------------------
    
    @import "responsive-utilities.less";
    
    
    // MEDIA QUERIES
    // ------------------
    
    // Large desktops
    @import "responsive-1200px-min.less";
    
    // Tablets to regular desktops
    @import "responsive-768px-979px.less";
    
    // Phones to portrait tablets and narrow desktops
    @import "responsive-767px-max.less";
    
    
    // RESPONSIVE NAVBAR
    // ------------------
    
    // From 979px and below, show a button to toggle navbar contents
    @import "responsive-navbar.less";
    
    0 讨论(0)
提交回复
热议问题