Skip to content
/ breeze Public

(experimental) Macro-powered, Tailwind-like CSS for Haxe

License

Notifications You must be signed in to change notification settings

wartman/breeze

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Breeze

Breeze is a port (more or less) of Tailwind into Haxe.

Usage

Breeze is a css-in-haxe library that works very much like Tailwind, just using macros instead of class names. While it can create and apply css at runtime, it's designed to generate a css file at compile time. This means that Breeze has very little overhead -- it compiles away to class name strings, a few helper functions and nothing else.

Here's a simple example of what Breeze looks like in action:

import Breeze;

final box = Breeze.compose(
	Flex.display(),
	Spacing.pad('y', 1),
	Spacing.pad('x', 2),
	Border.radius(3),
	Border.width(1),
	Border.style('solid'),
	Filter.dropShadow('md'),
	Modifier.hover(Filter.dropShadow('xxl')),
	ColorScheme.light(Border.color('black', 0)),
	ColorScheme.dark(Border.color('white', 0)),
	Css.rule('
		--test: #ccc;
		background-color: var(--test);
	')
);

Todo: more details about how all this works.

Compiler Setup

By default, Breeze will output a file named styles.css next to the compiler output. You can configure this with the -D breeze.output flag:

# Don't output anything:
-D breeze.output=none
# Don't output anything, but generate code for runtime
# styles:
-D breeze.output=runtime
# Output css to the given file name, relative to the
# compiler output path (a `css` extension will be added automatically): 
-D breeze.output=app-styles
# Output css relative to the current working directory
# (a `css` extension will be added automatically): 
-D breeze.output=cwd:assets/styles
# Output css to an absolute path:
-D breeze.output=abs:../project/assets/styles

About

(experimental) Macro-powered, Tailwind-like CSS for Haxe

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published