Wednesday, April 19, 2017

Managing the CSS Box Model

The following is an extract from our book, CSS Master, written by Tiffany Brown. Copies are sold in stores worldwide, or you can buy it in ebook form here.

[author_more]

Perhaps the most important point to understand about CSS is this: Everything is a box. More specifically, every element in a document generates a box. This box may be a block-level box, or it may be an inline-level box. The box type determines how the element affects page layout.

Whether or not an element creates a box and which type of box it creates will depend on the markup language. CSS developed as a way to style HTML documents so, as a result, much of the CSS visual rendering model is rooted in HTML's distinction between block-level and inline elements. By default, elements such as p and section create block-level boxes but a, span, and em create inline boxes. SVG, on the other hand, does not use the box model, so most layout-related CSS properties fail to work with SVG.

Continue reading %Managing the CSS Box Model%


by Tiffany Brown via SitePoint

Using Bookmark’s AIDA to Build Your Website in 2 Minutes

Starting your own business is one of the most exciting and scariest things you’ll ever do in your life. There’s so much to do and to learn, and trying to piece things together from different websites online is nearly an impossible task. There are all types of communities out there, but it’s tough to really find an all-inclusive package that will teach you the skills you need for success. If they do educate you, they rarely provide anything else to actually help you get set up. One platform, a website called Bookmark, sets out to change that.

What is Bookmark?

Bookmark is an all-inclusive platform that can help you get your website created in under two minutes. Bookmark eliminates 90% of the pain points associated with website building with a builder that is intuitive to use, while providing useful tools that business owners need, like SEO and website analytics.

Bookmark also includes an e-learning section to educate entrepreneurs on the things they need to know to run a successful business. While you might find similar platforms out there in terms of online education and courses, Bookmark wanted to set itself apart when it comes to how it helps entrepreneurs build websites. The Bookmark Website Builder has templates and a drag-and-drop builder that make building a business website incredibly easy.

AIDA: Your Artificial Intelligence Design Assistant

One thing I hear from business owners all the time is “I’m tech-savvy, but I am not a designer.” With AIDA, you don’t have to be. AIDA is an artificial intelligence design assistant that will walk you through building your website. Through analyzing and understanding your design wants and needs, AIDA helps you to make choices from millions of combinations to create a unique website for your business.

AIDA has the ability, using its guided system, to help you to build a website in 2 minutes. Not only is it a fully functional website, but it is ecommerce-ready and responsive. Imagine being able to build a website for your business in under 2 minutes? Most business owners and entrepreneurs don’t have time to sit down and learn how to build a website step-by-step.

Artificial intelligence that helps you to make design decisions is a truly revolutionary concept. AIDA will help you to make the right choices for your website, based on your needs, taking the guesswork out of website design for entrepreneurs and small business owners.

Features of Bookmark

E-learning: Understanding different parts of your business increases the chances that you’ll be more successful. It’s difficult to understand what to study and what you need to know. However, Bookmark has a selection of courses available to help you understand things like SEO, website analytics, how to use PayPal, and more.

Ecommerce: Want to sell physical goods? Setting up your own store is tough! However, Bookmark’s system has that capability built-in. You can be up and running, selling your products in minutes.

600+ businesses: Most website builders with templates only offer a few industries for you, which don’t fit well with what you’re trying to create. This means you have to spend a lot of time customizing the content for your business. AIDA is different, because there are over 600 different industry choices, making it easy to find one to suit your needs.

Mobile-ready: It’s no question that a majority of people browsing the web are doing so on their smart phones and tablets. Your website absolutely has to be mobile-friendly. Everything you build with Bookmark is responsive, without having to tweak CSS or know how to code.

SEO aid: Search engine optimization is at the top of many people’s lists. Going through the steps to optimize your website through other platforms can be a long-term learning experience, with a lot of trial and error involved. Bookmark helps you optimize your site for search engines, so that your business website is more likely to be found by the people looking for your products or services.

Analytics: Knowing who your website visitors are, their demographics, and what they are doing on your site will help you to understand what is bringing people to your site in the first place. Gauging performance can help you fine tune different aspects of your website to improve conversion rates. All of that is included with Bookmark.

Drag & drop: It seems like most platforms are including this feature. Being able to move, reorder, or restructure areas of your website is an essential part of streamlining the construction process. Create anything you can imagine with the drag-and-drop builder.

Hosting: Most web designers or developers will tell you that a website is only as good as its web host. This is true, considering it is the foundation of your entire website. From speed and performance to stability, you want a host that is robust and stable, giving you everything you need to deliver your website quickly. Bookmark has cloud hosting servers, so your website is both fast and secure.

AIDA choice

Getting Started

Right from the beginning, when you sign up for an account, you are given the choice to use the website builder, or to use AIDA, the Artificial Intelligence Design Assistant. For our purposes, we are going to choose AIDA.

Website type

AIDA starts asking you questions, with the first one being: “What type of website do you want to create?" The astonishing thing is the number of selections you have. You’ll find everything in the list from accounting, to acupuncture, bridal shops, building contractors, butcher shops, dance schools, daycares, IT services, Italian food, locksmiths, magicians, lawyers, website designers, realtors, and so much more. There are over 600 business types to choose from.

Recognition

For the example, I chose Realtor, and named the website “Knox Realtors Agency”. Once I entered this information in, it asked if I were one of the following realtors. The selection wasn’t valid, since I’m not really a realtor, so I continued.

Info

The next thing AIDA asked was for me to fill in my information. I put in mostly fake information for the example. AIDA also asks for a logo. I dropped in a generic logo for our test.

I was asked if I wanted ecommerce capabilities. I opted out, as it wasn't relevant to the real estate site I was building, but it's good to know that they're there if you need them.

Men's clothing

My Surprise and Delight

Once I’d entered in this brief information, the next screen brought me to a page asking if I wanted to let AIDA start the building process. I hit the start button, and AIDA started filling in a layout for the entire website. After about 30 seconds, all sections were finished, and I had a full page of content and sections to work with. Colors were automatically chosen, and I had something to work with.

Right now, I could hit publish and the site is fully functional. I tried it out myself, and was surprised by how fast it was to create my realtor website.

Real estate website

Editing and Refining

Of course, a lot of what is there is filler or basic content to give me an idea of what to build and what information to provide. Everything is easily selectable and customizable. You simply click on a section, highlight the text, and you can change the font size, color, weight, alignment, etc.

Continue reading %Using Bookmark’s AIDA to Build Your Website in 2 Minutes%


by James George via SitePoint

15 Reasons Why Customer Advocacy is the Bedrock of Your Business (infographic)

Not all customers are created equal. There are customers who buy from you once and disappear. There are customers who buy from you multiple times. And, then there are customers who buy from you over and over again, shouting your name from the rooftops. Obviously, the latter is pure gold....

[ This is a content summary only. Visit our website http://ift.tt/1b4YgHQ for full links, other content, and more! ]

by Irfan Ahmad via Digital Information World

Choosing between React and Angular: An in-Depth Comparison

Should I choose Angular, or React? Today's bipolar landscape of JavaScript frameworks has left many of developers struggling to pick a side in this debate. Whether you're a newcomer trying to figure out where to start, a freelancer picking a framework for your next project or an enterprise-grade architect planning a strategic vision for your company, you're likely to benefit from having an educated view on this topic.

To save you some time, let me tell you something up front: this article won't give a clear answer on which framework is better. But neither will hundreds of other articles with similar titles. I can't tell you that because the answer depends on a wide range of factors which make a particular technology more or less suitable for your environment and use case.

Since we can't answer the question directly, we'll attempt something else. We'll compare Angular (2+, not the old AngularJS) and React to demonstrate how you can approach the problem of comparing any two frameworks in a structured manner on your own and tailor it to your environment. You know, the old "teach a man to fish" approach. That way, when both are replaced by a BetterFramework.js in a year's time, you will be able to re-create the same train of thought once more.

Where to Start?

Before you pick any tool you need to answer two simple questions: "Is this a good tool per se?" and "Will it work well for my use case?" None of them mean anything on their own, so you always need to keep both of them in mind. All right, the questions might not be that simple, so we'll try to break them down into smaller ones.

Questions on the tool itself:

  • How mature is it and who's behind it?
  • What kind of features does it have?
  • What architecture, development paradigms, and patterns does it employ?
  • What is the ecosystem around it?

Questions for self-reflection:

  • Will I and my colleagues be able to learn this tool with ease?
  • Does is fit well with my project?
  • What is the developer experience like?

Using this set of questions you can start your assessment of any tool and we'll base our comparison of React and Angular on them as well.

There's another thing we need to take into account. Strictly speaking, it's not exactly fair to compare Angular to React, since Angular is a full-blown feature-rich framework, and React just a UI component library. To even the odds, we'll talk about React in conjunction with some of the libraries often used with it.

Maturity

An important part of being a skilled developer is being able to keep the balance between established, time-proven approaches and evaluating new bleeding-edge tech. As a general rule, you should be careful when adopting tools which have not yet matured due to certain risks:

  • The tool might be buggy and unstable.
  • It might be unexpectedly abandoned by the vendor.
  • There might not be a large knowledge base or community available in case you need help.

Both React and Angular come from good families, so it seems that we can be confident in this regard.

React

React is developed and maintained by Facebook and used in their own products, including Instagram and WhatsApp. It has been around for roughly three and a half years now, so it's not exactly new. It's also one of the most popular projects on GitHub with about 60,000 stars at the time of writing. Sounds good to me.

Angular

Angular (version 2 and above) has been around less then React, but if you count in the history of its predecessor, AngularJS, the picture evens out. It's maintained by Google and used in AdWords and Google Fiber. Since AdWords is one of the key projects in Google, it is clear they have made a big bet on it and is unlikely to disappear anytime soon.

Features

Like I mentioned earlier, Angular has more features out of the box than React. This can be both a good and a bad thing, depending on how you look at it.

Both frameworks share some key features in common: components, data binding, and platform-agnostic rendering.

Angular

Angular provides a lot of the features required for a modern web application out of the box. Some of the standard features are:

  • Dependency injection;
  • Templates, based on an extended version of HTML;
  • Routing, provided by @angular/router;
  • Ajax requests by @angular/http;
  • @angular/forms for building forms;
  • Component CSS encapsulation;
  • XSS protection;
  • Utilities for unit-testing components.

Having all of these features available out of the box is highly convenient when you don't want to spend time picking the libraries yourself. However, it also means that you're stuck with some of them, even if you don't need them. And replacing them will usually require additional effort. For instance, we believe that for small projects having a DI system creates more overhead than benefit, considering it can be effectively replaced by imports.

React

With React, you're starting off with a more minimalistic approach. If we're looking at just React, here's what we have:

  • No dependency injection;
  • Instead of classic templates it has JSX, an XML-like language built on top of JavaScript;
  • XSS protection;
  • Utilities for unit-testing components.

Not much. And this can be a good thing. It means that you have the freedom to choose whatever additional libraries to add based on your needs. The bad thing is that you actually have to make those choices yourself. Some of the popular libraries that are often used together with React are:

We've found the freedom of choosing your own libraries liberating. This gives us the ability to tailor our stack to particular requirements of each project and we didn't find the cost of learning new libraries that high.

Languages, Paradigms, and Patterns.

Taking a step back from the features of each framework, let's see what kind higher-level concepts are popular with both frameworks.

React

There are several important things that come to mind when thinking about React: JSX, Flow, and Redux.

JSX

JSX is a controversial topic for many developers: some enjoy it, and others think that it's a huge step back. Instead of following a classical approach of separating markup and logic, React decided to combine them within components using an XML-like language that allows you to write markup directly in your JavaScript code.

While the topic of mixing markup with JavaScript might be debatable, it has an indisputable benefit: static analysis. If you make an error in your JSX markup, the compiler will emit an error instead of continuing in silence. This helps by instantly catching typos and other silly errors. This is something we really miss in Angular.

Flow

Continue reading %Choosing between React and Angular: An in-Depth Comparison%


by Pavels Jelisejevs via SitePoint

Validate Object Graphs with Java Bean Validation’s @Valid Annotation

The Java Bean Validation's @Valid constraint annotation makes sure that when an object is validated, the validation recurses to all fields that are annotated with @Valid. This makes it really easy to perform the usually complex task of validating entire object graphs.

To make sense of this post you should know the basics of how to use Java Bean Validation.

Continue reading %Validate Object Graphs with Java Bean Validation’s @Valid Annotation%


by Alejandro Gervasio via SitePoint

Quick Tip: How to Build Your Custom Theme for Telescope Nova

How to Build a Telescope Nova Custom Theme

Telescope Nova is the perfect platform to use if you want to build your own social web app fast and easy. This is a free and open-source project created by Sacha Greif. The front-end development part of the app is built with the React library , while the back-end is taken care of by the Meteor framework. Both are written in JavaScript, one of the most popular programming languages today.

Since at work we are using Meteor.js for back-end development, it was next to impossible for us not to try to customize Telescope Nova, which is one of the most popular among Meteor apps.

In this quick tip, you will learn how to create your own custom theme for Telescope Nova. But first, a few words on how to get your development environment set up.

Installing Node.js , NPM and Meteor.js

Before you can install Nova, you need to have Node.js, NPM and Meteor.js already installed. If you haven't, proceed with the following installation steps:

  1. Install Node.js and NPM . If you are using Windows and struggle with installation, How to Install Node.js and NPM on Windows by Dave McFarland should be helpful
  2. Install Meteor.js.

Installing Telescope Nova

Now let’s install Nova on your localhost. On the command line, type:

[code language="bash"]
git clone http://ift.tt/1Fxijzw

cd Telescope

npm install

meteor
[/code]

Then you should be able to see the app running on http://localhost:3000/ .

Installing Telescope Nova

For more info about installing Nova, go to their GitHub instructions.

Creating Your Theme Package

Once your app is up and running, you can start to customize its default look by following the steps outlined below:

  1. Go inside your Telescope>packages folder. There you will find the folder my-custom-package
  2. Copy/Paste the my-custom-package folder and rename the copy, for
    example, custom-theme. Now you have created your own package
  3. Inside your custom-theme package, find the file package.js and open
    it in your editor. Replace this piece of code - name: “my-custom-package” — to match your package name. So in this case it will be name: “custom-theme”
  4. In the terminal, navigate to your Telescope folder and type: meteor add custom-theme to apply your new package to the app
  5. Then start the app using the command: meteor
  6. Finally, go to http://localhost:3000 where you should see this new look with
    star-shaped emojis around the logo.

Telescope Nova theme with star-shaped emojis around logo

Customizing Components

Continue reading %Quick Tip: How to Build Your Custom Theme for Telescope Nova%


by Jelena Jovanovic via SitePoint

How to Set Up a Project in Angular 2