Skip to content
This repository has been archived by the owner on Feb 26, 2018. It is now read-only.

Support for ->required() on the label within a form group #132

Merged
merged 2 commits into from
Apr 26, 2017

Conversation

clemblanco
Copy link
Contributor

By intercepting the required($conditional) function here we will add automatically the control-label-required CSS class to the <label> HTML element.

This way you are able to use CSS to style the <label> HTML element however you want, you can even use pseudo-elements to add an asterisk:

label.control-label-required:after {
    content: " *";
}

Obviously we wont interfere with Form Builder and we'll call the required() function defined within adamwathan/form no matter what. The CSS class will just be added conditionally.

By intercepting the `required($conditional)` function here we will add automatically the `control-label-required` CSS class to the `<label>` HTML element.

This way you are able to use CSS to style the `<label>` HTML element however you want, you can even use pseudo-elements to add an asterisk:
```css
label.control-label-required:after {
    content: " *";
}
```

Obviously we wont interfere with Form Builder and we'll call the `required()` function defined within `adamwathan/form` no matter what. The CSS class will just be added conditionally.
@coveralls
Copy link

coveralls commented Apr 25, 2017

Coverage Status

Coverage decreased (-1.6%) to 89.286% when pulling d94265c on Claymm:master into f593c33 on adamwathan:master.

@coveralls
Copy link

coveralls commented Apr 25, 2017

Coverage Status

Coverage increased (+0.2%) to 91.071% when pulling ebd0986 on Claymm:master into f593c33 on adamwathan:master.

@clemblanco clemblanco changed the title Support for ->required() on the label within a form group Support for ->required() on the label within a form group Apr 25, 2017
@clemblanco
Copy link
Contributor Author

Anyone pretty please? @adamwathan?

@adamwathan adamwathan merged commit 7f99288 into adamwathan:master Apr 26, 2017
@adamwathan
Copy link
Owner

Sure why not 🤷‍♂️

@clemblanco
Copy link
Contributor Author

@clemblanco
Copy link
Contributor Author

clemblanco commented Apr 26, 2017

Any chance this goes into a release? Would like to avoid having to use dev-master if possible.

@adamwathan
Copy link
Owner

Done

@clemblanco
Copy link
Contributor Author

Amazing! 🎉

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

Successfully merging this pull request may close these issues.

None yet

3 participants