GithubHelp home page GithubHelp logo

wingstyle's Introduction

Well, hey there.

WingStyle is a PHP/CSS-Framework ind evelopment. It's syntax is fairly easy:

<?php include "WingStyle/WingStyle.php"; ?>
<?=WS("html")
	->background->color("#ffffff")
->end?>

Yes, it's a singleton based code. Call WS and supply a selector. If you supply null, it won't do any pretty printing - instead it'll give you the raw CSS - so you can just add a rule on-the-fly if you're using hard-coded CSS till now.

To make your own CSS rule class (don't worry, I'll ad a load more later on - and even a fall-back mode if the class wasnt found!) follow this syntax:

<?php class WS_box_shadow extends WingStyleDesigner {

	public function main() {
		$this->addRule(new WingStyleRule("-webkit-box-shadow",implode(" ",func_get_args())));
	}
	
	// Since there are more versions than one of this rule, here is an idea how to do multi-browser rules.

	public function main() {
		$prefixes = array("-webkit-","-moz-","-o-");
		$string = implode(" ", func_get_args()); // This way you get all the args. Its faster than writing the vars yourself =)
		foreach($prefixes as $pf) {
			$rule = $pf."box-shadow";
			$this->addRule(new WingStyleRule($rule,$string));			
		}
	}

} ?>

Then place the file into the classes folder of WingStyle. Take note of the name - it MUST be prefixed with WS_ and end with .php! After that, you can then access your class like:

<?=WS("#content")->box_shadow(...)->end?>

...Now really - isn't that much smaller than writing:

#content {
	-webkit-box-shadow: ...;
	-moz-box-shadow: ...;
	-o-box-shadow: ...;
	box-shadow: ...;
}

Thus, you can use variables.

Oh yeah, variables...

You can change a special set of variables to influence how WS outputs the code:

string WS()->seperator

-> If you dont supply a selector, you can choose how the produced CSS is seperated. Defaults to a space.

string WS()->selector

-> Maybe you will want to modify this yourself, who knows.

bool WS()->beauty

-> If the code should be tabbed or not.

Check out the source code and the provided classes - there are a lot more options that I am just too lazy to describe. Once I am not lazy, you'll see a Wiki. For questions, you can use the issues tab or email me :3

wingstyle's People

Contributors

viatropolis avatar

Stargazers

Nikos M. avatar

Watchers

James Cloos avatar Ingwie Phoenix avatar  avatar

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.