Shopify App From Scratch #6 - Mockup Part 2

redcaptom

Red Cap Tom

Posted on May 28, 2020

Shopify App From Scratch #6 - Mockup Part 2

Deprecation Notice

Yeah, yeah, I know. I hate it too when people abandon tutorial series mid-way. But, due to (exciting!) circumstances, I'm calling it quits for now.

I'm thinking of just dropping a link to the full repo here - it's a mess, but it's something you guys can chew on instead of my empty promises.

If you'd like me to drop it here - let me know at hey@redcaptom.com.

And, just sayin', I had a BLAST doing this. If you know something - anything - about technology, take the time to write it down as a tutorial series. You will get SO, SO much value out of it, you can't even believe it.

Until we meet again - RCT :)

The Video (Scroll down for the article)

Coming soon!

In Comes CSS

If you follow the Video above, you'll notice that I'm building up a new HTML wireframe, that has a bunch of improvements and some custom CSS to make it prettier. Here's the new, final result:

new-wireframe

Here's the new HTML:

<html>
<head>
    <link rel="stylesheet" href="styles.css">
    <title>
        Countries We Ship Button
    </title>
</head>
<body>
    <div class="container">
        <div class="headerContainer">
            <div class="header">
                <h1>Countries We Ship To Button</h1>
            </div>
            <div class="prompt">
                <p>Please select the type of button you'd like to create:</p>
            </div>
        </div>
        <div class="singleButtonType1">
            <div class="type1Example">
                <button class="type1Button">Countries We Ship To Button</button>
            </div>
            <input type="checkbox" value="type1">Type 1
        </div>
        <div class="singleButtonType2">
            <div class="type2Example">
                <button class="type2Button">Countries We Ship To Button</button>
            </div>
            <input type="checkbox" value="type2">Type 2
        </div>
        <div class="toggle">
            <button class="toggleButton">Toggle</button>
        </div>
    </div>
</body>
</html>
Enter fullscreen mode Exit fullscreen mode

And the new CSS:

/* A lot of the information can be learned from Shopify Polairs */
/* Form elements use the default of the OS  */

html {
    /* Load system fonts */
    font-family: -apple-system, BlinkMacSystemFont, San Francisco, Roboto, Segoe UI, Helvetica Neue, sans-serif;
    /* Make type rendering look crisper */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Disable auto-enlargement of small text in Safari */
    text-size-adjust: 100%;
    /* Enable kerning and optional ligatures */
    text-rendering: optimizeLegibility;
}

/**
   * Form elements render using OS defaults,
   * so font-family inheritance must be specifically declared
   */

button,
input,
optgroup,
select,
textarea {
    font-family: inherit;
}

.container {
    display: grid;
    grid-template-columns: 200px 50px 50px 200px;
    grid-template-rows: auto;
    grid-template-areas: "header header header header" "type1 type1 type2 type2" ". toggle toggle .";
    row-gap: 20px;
}

.headerContainer {
    grid-area: header;
}

.singleButtonType1 {
    grid-area: type1;
}

.singleButtonType2 {
    grid-area: type2;
}

.toggle {
    grid-area: toggle;
}

.type1Button {
    /* So I can set a margin-bottom */
    display: inline-block;
    padding: 0.5em 1.5em;
    border-radius: 8px;
    border: 2px solid black;
    text-align: center;
    font-weight: bold;
    font-size: 1em;
    line-height: 1.65em;
    cursor: pointer;
    color: white;
    background-color: black;
    margin-right: 1rem;
    margin-bottom: 1rem;
}

.type2Button {
    /* So I can set a margin-bottom */
    display: inline-block;
    padding: 0.5em 1.5em;
    border-radius: 8px;
    border: 2px solid black;
    text-align: center;
    font-weight: bold;
    font-size: 1em;
    line-height: 1.65em;
    cursor: pointer;
    color: black;
    background-color: white;
    margin-right: 1rem;
    margin-bottom: 1rem;
}

/* 
.toggle {
    margin: auto;
} */

.toggleButton {
    padding: 15px;
    cursor: pointer;
    background-color: dimgray;
    border-radius: 5px;
    border-color: dimgray;
    border: 2px dimgray;
    font-size: large;
    color: black;
    font-weight: bold;
}
Enter fullscreen mode Exit fullscreen mode

This is basically done! We now have a proper wireframe we can refer to when building our app. You can follow the video for my entire thinking pattern, but if you're just up for the final result - now you have it:)

Moving on - let's learn a little bit about React in our first (!) sidestep, before going head-first into building our application. If you've got React chops feel free to bypass the next 3 articles, and jump straight to article 10, which deals with Shopify's design system, Polaris.

💖 💪 🙅 🚩
redcaptom
Red Cap Tom

Posted on May 28, 2020

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related