
đź‘‹ Oi, mga repapips, Brian Dys here! I love music, photography, and creative stuff like UX design and art. This is a place where I collect my thoughts and works. Apart all these, I’m Jaycelle’s better half and Bryce’s dad. 🥰
Imagine this ombre cake:
It looks yummy and it has layers.
It is similar with active elements – they must have three levels for the purpose of CSS.
The first level is the textual element itself. The second level holds the function of the active element (e.g., <a> or <button>). The third level is for positioning. Initially, it appears that the default way to put it is this way:
[html]
<a>Label</a>
[/html]
And since this is for the purpose of CSS, we must implement Framing for the textual element and for positioning. These frames will act as hooks for CSS. Look at this example:
[html]
<div> <!– Frame for positioning –>
<a>
<span> <!– Frame for textual element –>
Label
</span>
</a>
</div>
[/html]
Here’s a demo to show a floated button:
Oh and by the way, here’s an ombre potato:
Similar to UI State (which only has active or inactive), UI Condition can be anything to describe the condition of an object.
To denote that an article entry does not have content, we add the class ui-cond__entry--blank
which translates to “the UI condition of entry is blank”.
<div class="ui-cond__entry–blank"> … </div>
The main idea behind generic class names is to have a standard naming convention for common HTML patterns and attaching it to specific class names.
For example, here’s a simple HTML markup of Skip Link component:
<div class="comp skip-link_comp">
<a class="skip-link_axn" href="#content">Skip to content</a>
</div><!-- skip-link_comp -->
Notice that there are two generic class names attached to specific class names:
Only comp is suggested to have a separate class name for CSS debugging purposes.
The syntax is: specific-name_generic-name
Post in context: I am “refactoring” the existing HopScotch Free WordPress Theme . This is due to several improvements in standardization and content structure.
The example that I will be using is the most common element of web sites – the web site name and description. One encounters this in the form of web site logos and the usually the description is hidden from view.
Here are my notes as I go each step of the front-end design process.
title
 attribute to <a> elements accessed via tooltip; use it to display supplementary informationrole
 attributeHopScotch Champion of Content Structure
<h1> <a>HopScotch</a> </h1> <p>Champion of Content Structure</p>
<h1 class="name"> <a class="axn">HopScotch</a> </h1> <p class="desc">Champion of Content Structure</p>
<h1 class="name"> <a class="axn" title="Go to Home">HopScotch</a> </h1> <p class="desc">Champion of Content Structure</p>
Only generic names:
<div class="comp"> <h1 class="name"> <a class="axn">HopScotch</a> </h1> <p class="desc">Champion of Content Structure</p> </div>
The HTML markup of product-header_comp
 with specific class names:
<div class="comp product-header_comp"> <h1 class="product_name"> <a class="product-name_axn">HopScotch</a> </h1> <p class="product_desc">Champion of Content Structure</p> </div><!– product-header_comp –>
Note that comp
is one of the standalone generic class names.
—
There are several blog entries in Design DriveThru about the practical application of HTML and CSS, simple ideas as well. In order to put these entries in a clearer light, there needs to be specific categories where they fall under. This will put things in context so that the reader would know to which extent the entry applies to him or her.
For example, as we talk about Notes on SASS File Structure, how does one try to absorb this concept? You might ask if this entry is important for you as a web or front-end designer. The answer can be made easier by categorizing the topics.
The first categories deal with a particular web concept as being either of the two:
Theory deals with general principles.
Theory is a contemplative and rational type of abstract or generalizing thinking, or the results of such thinking. Depending on the context, the results might for example include generalized explanations of how nature works.
Source: Wikipedia
An example of a theory is CSS Principles.
Technique on the other hand, deals with practical application.
A technique is a procedure to complete a task.
Source: Wikipedia
An example of Technique is Recreating Spotify’s Album Cover.
There could also be an entry with both Theory and Technique as its categories, for example: Using <body> to Define UI States and Types. This entry talks about principles and demonstrates how to apply it.
The second part of categories is about the web being generally split into two – it is either:
The latter is from The Elements of User Experience by Jesse James Garrett.
Web Documents deals mainly with information like Wikipedia or a WordPress blog. This is the primitive beginnings of HTML wherein information are linked to other information via anchor elements.
Web Applications deals mainly with services that foster activities and enable the users to accomplish specific tasks. Good examples range from Google Sheets to InVision.
This category set could be mutual like Flickr, for example – it is a webapp yet it deals with images and videos with rich information.
I would be using these categories to contextualize entries mostly discussing HTML because each web object, whether a simple web document or a webapp deals with HTML.
Hopefully this categorization technique will be useful in mapping the context of Front-End Design entries.
Previously, I’ve discussed a class naming convention in the form of:
<generic>__<identifier>–<specific>
In this manner we are using a UI State class located up in the DOM tree – particularly in the body
to manipulate different UI elements under it.
Take this as an example: in a site’s header, both the main navigation and search form are located.
<header>
<h2 class="accessible-name">Header Content</h2>
<nav class="main-navigation">…</nav>
<form class="search-form">…</form>
</header>
How would you be able to affect the main navigation depending on the state of the search form if its class is only confined within its container? The answer might be “thru JavaScript” – undeniably, we would need JS in this topic but only for manipulating class names. The trick lies in putting the UI Type or UI State class in a place wherein both main navigation and search form are under it.
What benefit do we get in having a global class
located higher in the DOM tree? It lets us control different parts of the UI depending on the site’s or app’s UI Type or UI State.
It is important to reserve the highest element you can put a class on – which is html
(for pertinent class names), thus, the second highest element we could attach a class
attribute to is body
.
Going back to our example, we would use the following UI State class to define the state of the search form:
<body class="ui-state__search-form–active">
The body class
, in words, translates to “The UI State of the Search Form is Active”.
Now, whenever the search form is active, you can already manipulate the main navigation based on that state.
Take a look at the demo on CodePen:
See the Pen Using <body> to Define UI States and Types by Brian Dys Sahagun (@briandys) on CodePen.