Skip to content
This repository has been archived by the owner on Jun 19, 2019. It is now read-only.

FEATURE REQUEST: Applying more than one class to an UI element #76

Closed
TheCoordinator opened this issue Aug 21, 2014 · 3 comments
Closed

Comments

@TheCoordinator
Copy link

Following up on the previous issues, this is again another suggestion:

In CSS, you are able to apply multiple classes to an element. An example would be

<h1 id="one" class="two three">Lorem Ipsum</h1>

It seems to me that in Classy, we are only able to apply one class via cas_styleClass (Correct me if I'm wrong).

Is it possible to add this as a feature?

@TheCoordinator TheCoordinator changed the title Applying more than one class to an UI element FEATURE REQUEST: Applying more than one class to an UI element Aug 21, 2014
@keithnorm
Copy link
Contributor

You can add multiple style classes to any view in either of these ways:

view.cas_styleClass = @"one two three";

[view cas_addStyleClass:@"one"];
[view cas_addStyleClass:@"two"];
[view cas_addStyleClass:@"three"];

And all of the following style rules would apply:

UIView.one {}
UIView.two {}
UIView.three {}

However, selecting items based on multiple classes is NOT supported at this time, for example this won't apply to the view in the example above whereas it would if you are thinking in CSS terms:

UIView.one.two.three {}

Hope that helps!

@TheCoordinator
Copy link
Author

Thanks

@latteier
Copy link

I'll note that this doesn't work in the current cocoapod (0.2.4), but does work if using master from git.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants