NimbusKit
1.2.1 - Fork Nimbus on Github - Visit the Nimbus Wiki
The iOS framework that grows only as fast as its documentation
|
A simple translator from raw CSS rulesets to Objective-C values.
Objective-C values are created on-demand and cached. These ruleset objects are cached by NIStylesheet for a given CSS scope. When a memory warning is received, all ruleset objects are removed from every stylesheet.
Adds a raw CSS ruleset to this ruleset object.
Returns YES if the ruleset has a 'color' property.
Returns the text color.
Returns YES if the ruleset has a 'text-align' property.
Returns the text alignment.
Returns YES if the ruleset has a value for any of the following properties: font, font-family, font-size, font-style, font-weight.
Note: You can't specify bold or italic with a font-family due to the way fonts are constructed. You also can't specify a font that is both bold and italic. In order to do either of these things you must specify the font-family that corresponds to the bold or italic version of your font.
Returns the font.
Returns YES if the ruleset has a 'text-shadow' property.
Returns the text shadow color.
Returns YES if the ruleset has a 'text-shadow' property.
Returns the text shadow offset.
Returns YES if the ruleset has an '-ios-line-break-mode' property.
Returns the line break mode.
Returns YES if the ruleset has an '-ios-number-of-lines' property.
Returns the number of lines.
Returns YES if the ruleset has an '-ios-minimum-font-size' property.
Returns the minimum font size.
Returns YES if the ruleset has an '-ios-adjusts-font-size' property.
Returns the adjustsFontSize value.
Returns YES if the ruleset has an '-ios-baseline-adjustment' property.
Returns the baseline adjustment.
Returns YES if the ruleset has an 'opacity' property.
Returns the opacity.
Returns YES if the ruleset has a 'background-color' property.
Returns the background color.
Returns YES if the ruleset has a 'border-radius' property.
Returns the border radius.
Returns YES if the ruleset has a 'border' or 'border-color' property.
Returns the border color.
Returns YES if the ruleset has a 'border' or 'border-width' property.
Returns the border width.
Returns YES if the ruleset has a 'width' property.
Returns the width.
In combination with relativeToId, the margin fields control how a view is positioned relative to another.
margin-top: 0 means the top of this view will be aligned to the bottom of the view identified by relativeToId. A positive number will move this further down, and a negative number further up. A percentage will operate off the height of relativeToId and modify the position relative to margin-top:0. So -100% means "align top". A value of auto means we will align the center y of relativeToId with the center y of this view.
In combination with relativeToId, the margin fields control how a view is positioned relative to another.
margin-bottom: 0 means the bottom of this view will be aligned to the bottom of the view identified by relativeToId. A positive number will move this further down, and a negative number further up. A percentage will operate off the height of relativeToId and modify the position relative to margin-bottom:0. So -100% means line up the bottom of this view with the top of relativeToId. A value of auto means we will align the center y of relativeToId with the center y of this view.
In combination with relativeToId, the margin fields control how a view is positioned relative to another.
margin-left: 0 means the left of this view will be aligned to the right of the view identified by relativeToId. A positive number will move this further right, and a negative number further left. A percentage will operate off the width of relativeToId and modify the position relative to margin-left:0. So -100% means line up the left of this view with the left of relativeToId. A value of auto means we will align the center x of relativeToId with the center x of this view.
In combination with relativeToId, the margin fields control how a view is positioned relative to another.
margin-right: 0 means the right of this view will be aligned to the right of the view identified by relativeToId. A positive number will move this further right, and a negative number further left. A percentage will operate off the width of relativeToId and modify the position relative to margin-left:0. So -100% means line up the right of this view with the left of relativeToId. A value of auto means we will align the center x of relativeToId with the center x of this view.
Returns YES if the ruleset has an '-ios-tint-color' property.
Returns the tint color.
When relativeToId is set, a view will be positioned using margin-* directives relative to the view identified by relativeToId.
You can use id notation, e.g. #MyButton, or a few selectors: .next, .prev, .first and .last which find the obviously named siblings. Note that the mechanics or margin are not the same as CSS, which is of course a flow layout. So you cannot, for example, combine margin-top and margin-bottom as only margin-top will be executed.
Relative positioning also requires that you're careful about the order in which you register views in the engine (for now), since we will evaluate the rules immediately. TODO add some simple dependency management to make sure we've run the right views first.
For views that support sizeToFit, padding will add a value to the computed size.
For views that support sizeToFit, padding will add a value to the computed size.