An open source CSS implementation for Xamarin mobile development tools
- Monotouch
This is still in very early development stage. Would love feedback, contributions etc.
CSS
* {
font-size: 18px;
font-family: GillSans;
}
#sample-button {
height: 55px;
width: 200px;
opacity: 0.5;
top: 50px;
left: 75px;
color: #FFFFFF;
border-radius: 4px;
border-width: 2px;
border-color: #000000;
background-color: #FF0000;
}
.sample-background {
background-image: url('background.jpg');
border-color: #DDDDDD;
border-width: 5px;
}
C#
using Crayon;
using Crayon.MT;
...
var styleContext = new StyleContext (new IOSDeviceContext ());
styleContext.LoadStyleSheet ("style.css");
var button = UIButton.FromType (UIButtonType.Custom);
button.SetStyleId ("sample-button");
var background = new UIView();
background.SetStyleClass ("sample-background");
background.AddSubview(button);
Output
- This project makes extensive use of ExCSS
Twitter - @jamilgeor Website - https://jamilgeor.com