Coding Journal #1: CSS Grid & Using Vim

in #steemdev7 years ago

journal-1.0c95a936fb6748749e4a921462bcb722.png

Emoji Source

Today I started converting the design for my first full-stack project into code. I did my best to use Vim throughout the process, but I’m about as effective as if I tried to code with my feet. I can still see the potential though so I’m excited to keep improving!

Design First


I’m so glad I designed the site before I started coding anything. Everything is already decided, including the font sizes and colors. I just need to refer to my Sketch document as a blueprint.

When I made my Japanese dictionary, it took forever to tinker with the design in HTML and CSS. I would spend hours tweaking something small and then refreshing the page to see how it looked — not a very efficient workflow.

Later today and tomorrow I’m going to mock up the API calls to my database so I can get a sense of how I want to structure the data. This will also let me get to a point where I have a functioning site that is composed solely of front end code. After that I just need to sub out my mock API calls for the real ones.

Here’s the index page I designed and my first attempt at converting it to HTML and CSS:

Screen Shot 2018-01-30 at 4.02.09 PM.f6e5fdd1264644bab1508ad004dd462b.png

Screen Shot 2018-01-30 at 6.58.57 PM.65f94fe948b146699c6c3d2b38f2f8ac.png

Live Editing in Webstorm


Recently I started using the Webstorm IDE. It has had a bit of a learning curve, but overall I’m liking it a lot. I’m still on the fence if it will end up replacing VS Code as my main editor.

One cool feature I started using today was live editing. With this I’m able to see the changes I make to the front end code live in the browser.

live_edit.69abb149e73440c0ba5152f1ea82e9e4.gif

I’m guessing this feature is available in other editors as well, but here’s an explanation of how to do it in Webstorm. Much easier than refreshing the page every time you make a change.

CSS Grid


For most of my front end projects up until this point, I’ve used Bootstrap to help set up my 12 column layout. I can’t use it for what I’m working on now (not allowed by Thinkful), but I realized last week that I can try using CSS Grid. I had never used it before today, but it’s actually much more straightforward than I was expecting.

Creating a grid of divs only takes a couple lines of code, applied to the surrounding div.

display: grid;
grid-template-columns: repeat(3, 1fr);
grid-gap: 15px;

 
That’s how I got the course tiles to look like this:

Screen Shot 2018-01-30 at 4.14.49 PM.0b0b2a33d35f485cb1ba1c28708c60c5.png

Like Vim, I learned this through playing a game: CSS Grid Garden. 🙂 It only took about 30 minutes to finish the whole thing, and it’s completely free.

Screen Shot 2018-01-30 at 12.48.38 PM.5f827966e0f441a586b3d6206ef6178a.png

I also watched this video before I got started and it provided a good overview:

Lastly, here’s a great guide from CSS Tricks. I use their guide for flexbox all the time.

After getting started on this today, I’m actually starting to feel like I might prefer to use a combination of flexbox and grid over the responsive layout provided by Bootstrap. This way I don’t have to fight against the features built into Bootstrap, and instead have more control over each thing I want to do.

I’m surprised with how comfortable I felt coding up this first page today. In the past, I would pretty much always get stuck on some minor CSS annoyance, like two things being out of alignment by 3 pixels. I think what has helped me the most is practice with flexbox because it offers a more straightforward solution to those frustrating alignment problems.

It looks like the person who made the CSS Grid game above also has a flexbox game called Flexbox Froggy that I might have to try out.

Screen Shot 2018-01-30 at 7.04.16 PM.18ec8ba7257f42979d13370699f0fdd0.png

Struggling With Vim


Vim is still a struggle! I feel like I’m learning to type all over again. I’m glad I’ll get to have a more experienced user of Vim looking over my shoulder 3 hours a week to point out how I could be more efficient with it (through my mentor sessions).

I keep attempting to do one thing and accidentally adding or deleting stuff all over the place. 😆 But I’m really glad I got started with it because I’ll get a ton of practice over the next couple weeks as I get deeper into my project.

Coding to Fuel Posting


One of my goals here on Steemit is to use writing posts as an excuse to get myself to code consistently and learn as many new things as possible each day. I want to continue posting frequently on here, and in order to do that I need new things to write about. If I start to fall behind on my coding projects, it means I'll miss out on making some money from the Steemit posts they would lead to. Pretty good motivation! Especially because I’m really enjoying publishing on here and I feel great when I’m able to create a post I’m proud of.

This reminds me of some of the advice I saw given out by daily vloggers — to make interesting new content every day, you have to do new and interesting things every day. I’m a little too shy to go out and do interesting things every day like a vlogger, but I’m happy to learn new things every day and share them here. 🙂

I think one of the best ways I’ll be able to stay consistent with writing posts, is to work on side projects. My series on making my first Steem.js app was really fun to write. Working on the project ended up creating its own narrative — with each post I got to just sit down and tell a short story.

Thanks for reading my first coding journal! I’m going to use these to report on my experiences when they don’t fit easily into a single topic. If you have an recommendations about any of the things I talked about, please let me know in the comments!


follow_jeffbernst.gif

Sort:  

Yeah, That's a great workflow when you first design than code because everything is already mentioned in the design like font-size, color and white space etc.

It looks cool that Thinkful doesn't allow you guys using bootstrap framework right now at a beginner stage, because every web developer should learn the core CSS first then move up to other frameworks. like bootstrap, foundation and semantic UI.

I appreciate that you learned CSS grids by doing and create an amazing website.

Your editor is looking cool!, I recommend 2 more editors that I am using and that's great.

Atom and SublimeText

Yeah, I was mad that I couldn't use Bootstrap at first, but I think they were right in that decision. I'll get more CSS practice and CSS grid seems great!

Thanks for the code editor recommendations! I actually used Sublime Text before VS Code and it was really nice. I tried Atom out briefly but I don't have a ton of experience with it.

Thanks for reading! 🙂

Exactly, Core CSS is cool!

It's wonderful that you already used sublime text. yeah the more you do coding on atom, the more experience you'll get.

Coin Marketplace

STEEM 0.16
TRX 0.15
JST 0.028
BTC 53801.93
ETH 2252.31
USDT 1.00
SBD 2.26