Giter VIP home page Giter VIP logo

bootstrap-builder's Introduction

Build Status Coverage Status

bootstrap-builder

Bootstrap Builder allows you to create override files in a subdirectory of bootstrap/less/ thus keeping the source files unchanges and easy to update from upstream.

Usage

java -jar bootstrap-builder-<version>-jar-with-dependencies.jar source_dir override_dir output_dir

Prerequisites

Quick start

  • Clone the repo: git clone [email protected]:kmulvey/bootstrap-builder.git.
  • mvn install
  • creating the binary jar: mvn clean compile assembly:single

Override file format

The format of this file looks similar to a diff file and tweaking an actual diff is a good way to get started.

  • Remove a property: line begins with a '-': - margin-left: 20px;

  • Add a property: line begins with a '+': + background: #333;

  • Remove a block: selector line begins with a '-'. There is no need to give the contents of the block as we are simply going to find that selector and remove the whole thing.

It is important that there not be any space in front of the +/-, they cannot have space or tabs before them.

-.well-small {
}
  • Add a block: selector line begins with a '+'.
+.well-large {
		padding: 24px;
		.border-radius(6px);
}
  • When changing a nested selector be sure to correctly specify the parent selectors
.btn{
		&:focus {
-		.tab-focus();
+		outline: none;
		}
}
  • A complete example
.well {
-	margin-bottom: 20px;
-	background-color: @wellBackground;
-	border: 1px solid darken(@well-bg, 7%);
+	border: 1px solid darken(@wellBackground, 70%);
		blockquote {
-		border-color: #ddd;
+		border-color: rgba(255, 255, 255);
		}
}
+.well-large {
	padding: 24px;
	.border-radius(6px);
}
-.well-small {
}
  • Change a selector: The first selector is what you are looking for, the second is what you are replacing it with. You can still put properties in the block. Be sure to put the {} at the end of the new selector.
button
%
.btn {
+	padding: 24px;
-	.border-radius(6px);
}
input[type="checkbox"],
input[type="text"],
input[type="button"] 
%
input[type="submit"],
input[type="reset"],
input[type="button"] {}

note: do not put comments at the end of a line, put them on their own line. White space at the end of lines also breaks. These should both be fixed at somne point.

Running tests

  • mvn test

bootstrap-builder's People

Contributors

kmulvey avatar sblaurock avatar

Stargazers

 avatar

Watchers

 avatar  avatar

bootstrap-builder's Issues

linear runner needed

we need a runner that compiles one file at a time i.e. in a for() loop

Main.java should be renamed to ThreadedRunner.java
new file should be LinearRunner.java

they should both be able to run LessRunner.java

fontface

5 +@font-face{
6   font-family:'FranklinGothicMedium';
7   src: url(//:) format('no404'),
8   url('@{headingsFontPath}FranklinGothic-Med-webfont.woff') format('woff'),
9   url('@{headingsFontPath}FranklinGothic-Med-webfont.ttf') format('truetype'),

10 url('@{headingsFontPath}FranklinGothic-Med-webfont.svg') format('svg');
11 font-weight:400;
12 font-style:normal;
13 }

rename selector for mixins

basically this test needs to pass and does not currently, this is because the regex that tries to determine if a % is within () does not work well. This regex lives on line 28 of Block.java. When done it can probably be combined with line 27. The whole reason for this regex is to differentiate between and update of the selector and a % in a normal selector (i.e. defaulting % values in a mixin signature)

@test
public void renameMixin() {
Block b = new Block(".box-shadow(@shadow)%.box-shadow(@ShadowA, @ShadowB:X, ...)");
b.process();
Assert.assertEquals("update", b.getAction());
Assert.assertEquals(".box-shadow(@shadow)", b.getSelector());
Assert.assertEquals(".box-shadow(@ShadowA,@ShadowB:X,...)", b.updated_selector[1]);
}

sample LESS
.box-shadow(@shadow)
%
.box-shadow(@ShadowA, @ShadowB:X, ...){

btw, this is a blocker for v2.3.2

update selectors

need to be able to do this:

-.btn-link,
-.btn-link:active,
-.btn-link[disabled] {
+.btn.btn-link,
+.btn.btn-link:active,
+.btn.btn-link[disabled] {
background-color: transparent;
background-image: none;
.box-shadow(none);

  • text-shadow: none;
    }

comments in override files

this has gotten better for comments on their own line do not effect the next line however the following does not work:

  • // z-index: 2;
    

in my opinion you should not do that, you should just delete the rule entirely

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.