Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add macros (discussion, do not merge) #204

Closed
wants to merge 3 commits into from
Closed

Add macros (discussion, do not merge) #204

wants to merge 3 commits into from

Conversation

joelanman
Copy link
Contributor

In order to add auto data storage (#157), we need macros to generate form fields. This is because the code to populate field values with data the user has entered is complex. I don't think users of the kit will find it easy to write that code for each field.

Macros also help us make prototypes accessible, again without our users having to learn that HTML.

I think we should try and keep each macro as simple as possible as an MVP.

This PR is for discussion, for example is macro. the right naming convention? Should allowing users to easily add their own macros be part of this PR?

Example of usage:

<form action="">

  <div class="form-group">

    {{ macro.text('First name') }}   

  </div>

  <div class="form-group">

    {{ macro.text('Last name') }}  

  </div> 

  <div class="form-group">

    <h2 class="heading-medium">
      Role
    </h2>

    {{ macro.radio('Role', 'Teacher') }}

    {{ macro.radio('Role', 'Student') }}

    {{ macro.radio('Role', 'Administrator') }}

  </div> 

  <div class="form-group">

    <h2 class="heading-medium">
      How do you get to school?
    </h2>

    <p>Select all that apply</p>

    {{ macro.checkbox('Bicycle') }}

    {{ macro.checkbox('Bus') }}

    {{ macro.checkbox('Car') }}

    {{ macro.checkbox('Train') }}

  </div> 

</form>

@joelanman joelanman changed the title Add macros (do not merge) Add macros (discussion, do not merge) May 28, 2016
@joelanman
Copy link
Contributor Author

Previous work here: #99

@timpaul
Copy link
Contributor

timpaul commented Sep 6, 2017

Suggest we close this now. We're developing templates as part of GOV.UK Frontend so once the Kit is consuming that they will be available to it's users.

@timpaul
Copy link
Contributor

timpaul commented Sep 22, 2017

Closing this now

@timpaul timpaul closed this Sep 22, 2017
@joelanman
Copy link
Contributor Author

Just a note that macros for production might be too complex for the users of the kit, so we may still need our own.

@kr8n3r kr8n3r deleted the macros branch November 6, 2018 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants