Naturally Flow and the “Box” Problem

 

 The design philosophy described in the video emphasizes a profound understanding of space, both physical and digital, paralleling the architectural vision of Frank Lloyd Wright. By viewing the screen as a viewport into a vast virtual landscape, we can transcend the limitations of traditional UI design, allowing for a more immersive and intuitive user experience.

Expanding the Design Canvas

In this approach, the design canvas extends beyond the confines of a flat screen. It recognizes that our digital environments can emulate the depth and complexity of the physical world. Just as Wright’s architecture considers the arrangement of rooms to create fluidity and harmony, digital design should facilitate the natural flow of content. This perspective allows for multiple axes of interaction, enabling us to position information in ways that enhance accessibility and engagement.

Content-Driven Design

The arrangement of content should not be arbitrary. Instead, it should be driven by the nature of the content itself, promoting clarity and purpose. The form should emerge organically from the function, rather than being dictated by trends or aesthetic whims. This principle resonates with Wright’s philosophy of organic architecture, where each element serves a distinct purpose and contributes to the whole.

Case Study: SpaceX Tool

A practical illustration of this philosophy can be seen in the tool developed by SpaceX for designing rocket components. This tool eschews cluttered interfaces, opting instead for a layout that presents information contextually. As engineers focus on specific engine components, relevant data appears seamlessly within their workspace. This contextual relevance mirrors the open spaces in Wright’s designs, allowing for unobstructed creativity and efficient workflow.

Intuitive Interaction

To enhance the user experience further, SpaceX utilizes the Leap Motion Controller, which allows engineers to interact with the design using natural hand movements. This approach embodies the idea of sculpting rather than merely clicking or tapping, making the experience more intuitive and aligned with human gestures. By integrating such technology, the design not only adheres to Wright’s principles but also emphasizes the importance of material usage and functional simplicity.

Conclusion

In summary, the digital design process should aspire to create environments that feel expansive and natural, echoing the principles of organic architecture. By prioritizing content, context, and intuitive interaction, we can craft user experiences that are not just functional but also deeply engaging. Just as Wright’s structures harmonized with their surroundings, so too should our digital interfaces resonate with the needs and behaviors of their users, fostering an organic flow of information and interaction.

Design Form and function as One Unit

To compare and contrast the philosophies of Louis Sullivan and Frank Lloyd Wright regarding the relationship between form and function in architecture, let’s break down the key points and elaborate on their significance:

Louis Sullivan: “Form Follows Function”

  1. Core Principle: Sullivan famously stated that “form ever follows function,” emphasizing that the design of a building should be primarily guided by its intended use. In Sullivan’s eyes, function was paramount, and aesthetic qualities should naturally evolve from this primary function.
  2. Architectural Clarity: For Sullivan, this principle meant that the structure of the building should clearly express its purpose. For example, the design of tall office buildings during the early 20th century should reflect their role as spaces for productivity and commerce, often resulting in designs that highlighted verticality and functionality.
  3. Historical Context: Sullivan’s ideas can be traced back to the early Roman architect Vitruvius, who espoused that buildings should be “firm, useful, and beautiful.” Sullivan appropriated these principles and articulated them in the context of modern architecture, focusing on how buildings should serve societal needs.

Frank Lloyd Wright: “Form and Function Should Be One”

  1. Philosophical Evolution: Wright built upon Sullivan’s ideas but offered a broader interpretation. He argued that “form and function should be one joined in spiritual union,” suggesting that the two elements are not distinct but rather intertwined in a harmonious relationship.
  2. Aesthetic Flexibility: This philosophy allowed Wright the creative liberty to innovate beyond strict functionalism. While maintaining practicality, he emphasized the aesthetic qualities of architecture, leading to designs that were not only functional but also deeply expressive. His buildings often echoed the landscape and blended into their environment, as seen in works like Fallingwater.
  3. Human Experience: Wright’s approach also placed importance on the human experience within architecture. He believed that spaces should be designed not just for utility but also to evoke emotions and connections with the surrounding environment. This led to organic architecture—designs that emphasize harmony between human habitation and nature.

Comparative Analysis

  • Function vs. Aesthetic Integration: While Sullivan focused on functionality dictating form, Wright considered both aspects as interdependent. Sullivan’s designs might prioritize function at the risk of aesthetic monotony, whereas Wright’s philosophy encouraged a more balanced approach that celebrated both functionality and artistic expression.
  • Historical Context: Both architects drew influence from Vitruvius, yet their interpretations reflect different historical contexts—Sullivan during the rise of industrialism and urbanization, and Wright amidst growing movements toward modernization and environmental harmony.
  • Legacy and Influence: Sullivan’s phrase continues to resonate in modern architecture, where functionality remains a key concern. Wright’s inclusive approach paved the way for the development of various architectural styles, encouraging architects to explore the emotional and philosophical dimensions of their work.

Conclusion

In essence, while Louis Sullivan’s mantra of “form follows function” emphasizes practicality and clarity, Frank Lloyd Wright expanded this dialogue to encompass a holistic vision where form and function exist in a symbiotic relationship. Their legacies continue to influence architects today, providing a spectrum of philosophies on how best to approach design in an ever-evolving world. Wright’s adaptation ultimately promotes a deeper understanding of the impact of architecture on human experience and the environment.

OOCSS Principles, why even bother?

Object-Oriented CSS (OOCSS) is a methodology that applies object-oriented principles to CSS to enhance both the performance and maintainability of stylesheets. By encouraging code reuse and modular design, OOCSS seeks to reduce repetition and streamline development, making stylesheets easier to scale and maintain.

Key Principles of OOCSS

  1. Separation of Structure and Skin
    • Structure refers to properties like width, height, margins, padding, and positioning.
    • Skin refers to visual properties like colors, fonts, borders, and shadows.
    • By separating these, you can reuse structure-related styles across various elements while applying different skins to customize their appearance.
  2. Separation of Containers and Content
    • Styles should be independent of the specific container in which they are used, allowing them to be reused across different parts of a webpage.
    • Avoiding descendant selectors and styling based on container contexts helps make your CSS more modular.

Benefits of OOCSS

  1. Faster Websites: Reducing repetitive styles results in smaller CSS files, which load faster.
  2. Scalability: You can reuse styles easily as your project grows, making it simpler to scale CSS for large applications.
  3. Maintainability: Modular styles are easier to track, debug, and modify. When new developers join a project, they can extend or reuse existing styles without creating complex or conflicting rules.
  4. Efficiency: Having less code to maintain and apply makes development quicker and more efficient.
  5. Readability: Well-structured OOCSS makes it easier for other developers to understand your code.

Example of Applying OOCSS

Instead of repeating styles for multiple elements, OOCSS encourages you to abstract common styles into reusable classes.

Before OOCSS:

#button {
    width: 200px;
    height: 50px;
    background: #ccc;
    border: 1px solid #ccc;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
}
#box {
    width: 400px;
    background: #ccc;
    border: 1px solid #ccc;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
}
CSS

After OOCSS:

.button {
    width: 200px;
    height: 50px;
}

.box {
    width: 400px;
}

.skin {
    background: #ccc;
    border: 1px solid #ccc;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
}
CSS

Now, you can apply the skin class to multiple elements to reuse the visual properties.

Understanding Object-Oriented CSS (OOCSS)

As web development continues to evolve, the complexity of managing CSS grows with it. With the rise of interactive web applications and intricate designs, developers are increasingly turning to methodologies that offer more structure and maintainability to their stylesheets. One such methodology is Object-Oriented CSS (OOCSS), proposed by web developer Nicole Sullivan in 2008. OOCSS applies principles from object-oriented programming to CSS, allowing developers to create reusable, scalable, and maintainable styles. This article delves into the core principles of OOCSS, its advantages and disadvantages, and how it can significantly improve the performance and maintainability of web pages.

The Principles of OOCSS

At the heart of OOCSS are two main principles: the separation of structure from skin, and the separation of containers from content.

1. Separation of Structure from Skin

The first principle of OOCSS focuses on distinguishing between the structural properties of an element and its visual properties. In web design, structure refers to the layout aspects of an element, such as size, padding, and positioning, while skin refers to the aesthetic aspects, such as color, font, and texture. By separating these two aspects, developers can create modular components that can be reused across different contexts.

Example:

Before OOCSS Implementation:

.button {
    width: 150px;
    height: 50px;
    background: #FFF;
    border-radius: 5px;
}

.button-2 {
    width: 150px;
    height: 50px;
    background: #000;
    border-radius: 5px;
}
CSS

In the above code, there is a lot of repetition, particularly in defining width, height, and border-radius.

After OOCSS Implementation:

.skin {
    width: 150px;
    height: 50px;
    border-radius: 5px;
}

.button {
    background: #FFF;
}

.button-2 {
    background: #000;
}
CSS

Here, the structural styles are abstracted into a reusable .skin class, which can be combined with different skin classes. This reduces redundancy and makes it easier to manage the CSS.

2. Separation of Containers from Content

The second principle emphasizes separating the styling of containers from their content. This ensures that styles applied to elements are not overly dependent on their parent containers, which enhances reusability and predictability.

Example:

Before OOCSS Implementation:

#sidebar {
    padding: 2px;
    left: 0;
    margin: 3px;
    position: absolute;
    width: 140px;
}

#sidebar .list {
    margin: 3px;
}

#sidebar .list .list-header {
    font-size: 16px;
    color: red;
}

#sidebar .list .list-body {
    font-size: 12px;
    color: #FFF;
    background-color: red;
}
CSS

In this example, the styles are tightly coupled with the #sidebar container, making it difficult to reuse the .list, .list-header, and .list-body classes outside of that context.

After OOCSS Implementation:

.sidebar {
    padding: 2px;
    left: 0;
    margin: 3px;
    position: absolute;
    width: 140px;
}

.list {
    margin: 3px;
}

.list-header {
    font-size: 16px;
    color: red;
}

.list-body {
    font-size: 12px;
    color: #FFF;
    background-color: red;
}
CSS

With OOCSS, the container and content styles are defined independently. This modular approach allows developers to reuse styles more effectively across different components, regardless of their context in the document.

Advantages of OOCSS

The benefits of adopting OOCSS are manifold, especially for larger projects where CSS can quickly become complex and unwieldy.

1. Faster Websites

By minimizing repetitive styles, OOCSS helps reduce the size of CSS files. Smaller stylesheets lead to faster download times, improving the overall performance of web pages. Although it may introduce a slight increase in the HTML file size due to additional class attributes, the performance gains from optimized stylesheets often outweigh this drawback.

2. Maintainable Stylesheets

OOCSS encourages the creation of a maintainable stylesheet by reducing specificity conflicts and fostering a modular approach. Rather than creating unique styles for each component, developers can leverage existing modules, making updates and additions much easier. As projects evolve, new components can be built on top of existing styles, ensuring consistency and reducing the likelihood of introducing bugs.

3. Scalability

OOCSS supports scalable design by allowing developers to reuse style modules across various elements. As a project grows, developers can freely combine and reapply classes without worrying about specificity or conflicts. This is particularly beneficial in larger teams where different developers may work on different components.

4. Enhanced Readability

With its focus on modular design, OOCSS makes CSS more readable. Other developers can quickly understand the structure and intent of the styles, which is crucial for collaboration. Clear naming conventions and organized class structures improve communication and reduce the learning curve for new team members.

5. Efficiency

Fewer lines of code mean that developers can scan and edit styles more efficiently. When styles are defined once and reused, the development process becomes more streamlined, allowing for quicker iterations and modifications.

6. Reduced Duplication of Efforts

By following the DRY (Don’t Repeat Yourself) principle, OOCSS eliminates redundant styles. This not only saves time but also reduces the chances of inconsistencies that can arise when multiple developers inadvertently create similar styles.

Disadvantages of OOCSS

While OOCSS offers numerous benefits, it is not without its challenges. Developers should be aware of these potential downsides when considering its implementation.

1. Learning Curve

For developers unfamiliar with object-oriented programming principles, adapting to OOCSS can take time. Understanding the concepts of separation and modularity may require a shift in mindset, especially for those accustomed to traditional CSS practices.

2. Increased HTML Markup

One criticism of OOCSS is that it can lead to more cluttered HTML markup due to the increased use of classes. This can make the HTML harder to read, particularly in simpler projects where a lightweight structure is preferable. However, the trade-off is often worthwhile for larger applications where maintainability and performance are critical.

3. Overhead for Small Projects

For smaller projects or simple static sites, the overhead of implementing OOCSS may not be justified. In such cases, a more straightforward approach might be sufficient, as the benefits of modular CSS become more apparent in larger, more complex applications.

4. Potential for Over-Engineering

In an effort to adhere to OOCSS principles, developers might over-engineer their CSS, creating unnecessary abstractions. It is essential to strike a balance between modularity and simplicity, ensuring that styles remain straightforward and easy to understand.

Real-World Example: Applying OOCSS

To illustrate how OOCSS can be effectively applied in a real-world scenario, consider the design of a web page featuring multiple button styles and layout containers.

Initial CSS (without OOCSS):

.button-primary {
    width: 120px;
    height: 40px;
    background-color: blue;
    color: white;
    border-radius: 5px;
}

.button-secondary {
    width: 120px;
    height: 40px;
    background-color: grey;
    color: black;
    border-radius: 5px;
}

.container {
    width: 960px;
    margin: 0 auto;
    padding: 20px;
}
CSS

In this example, the button styles are not reusable, leading to duplication of properties.

Refactored CSS (with OOCSS):

.button {
    width: 120px;
    height: 40px;
    border-radius: 5px;
}

.button-primary {
    background-color: blue;
    color: white;
}

.button-secondary {
    background-color: grey;
    color: black;
}

.container {
    width: 960px;
    margin: 0 auto;
    padding: 20px;
}
CSS

By introducing a base .button class for shared properties, the code becomes more modular and maintainable.

Guidelines for Implementing OOCSS

Getting started with OOCSS may require some adjustments to your development practices. Here are a few guidelines to help you transition to an OOCSS mindset:

  1. Avoid Descendant Selectors: Focus on using class-based selectors rather than descendant selectors to ensure styles are reusable.
  2. Favor Classes Over IDs: Rely primarily on classes for styling rather than IDs, as classes provide more flexibility and avoid specificity issues.
  3. Modularize Styles: Identify repeating patterns in your CSS and create reusable modules that can be applied across different elements.
  4. Use Naming Conventions: Establish clear naming conventions for classes that reflect their purpose and usage, improving readability and maintainability.
  5. Utilize Tools: Consider using tools like CSS Lint to check for code quality and adherence to OOCSS principles.

Conclusion

Object-Oriented CSS (OOCSS) is a powerful methodology that can significantly enhance the performance, maintainability, and scalability of web stylesheets. By embracing the principles of separation of structure from skin and separation of containers from content, developers can create modular, reusable components that streamline the development process. While OOCSS may not be suitable for every project, particularly smaller ones, its advantages become increasingly apparent as web applications grow in complexity. By adopting an OOCSS approach, developers can produce faster, more efficient, and easier

jQuery noConflict Wrappers

The jQuery library included with WordPress is set to the noConflict() mode (see wp-includes/js/jquery/jquery.js). This is to prevent compatibility problems with other JavaScript libraries that WordPress can link. In the noConflict() mode, the global $ shortcut for jQuery is not available, so you can still use:
jQuery(document).ready(function(){
    jQuery(#somefunction) ...
});
but the following will either throw an error, or use the $ shortcut as assigned by another library.
$(document).ready(function(){
     $(#somefunction) ...
});
However, if you really like the short $ instead of jQuery, you can use the following wrapper around your code:
jQuery(document).ready(function($) {
    // Inside of this function, $() will work as an alias for jQuery()
    // and other libraries also using $ will not be accessible under this shortcut
});
That wrapper will cause your code to be executed when the DOM is fully constructed. If, for some reason, you want your code to execute immediately instead of waiting for the DOM ready event, then you can use this wrapper method instead:
(function($) {
    // Inside of this function, $() will work as an alias for jQuery()
    // and other libraries also using $ will not be accessible under this shortcut
})(jQuery);
Alternatively, you can always reasign jQuery to another shortcut of your choice and leave the $ shorcut to other libraries:
var $j = jQuery;

How to repeat a background SVG image in Internet Explorer 10

For whatever reason, Internet Explorer 10 does not support the repeating of SVG-based background images out of the box. That is, not unless the markup is changed a bit. Here is an example of the<svg> element inside an SVG file: <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 149 50" enable-background="new 0 0 149 50" xml:space="preserve"> We need to make Internet Explorer 10 preserve the aspect ratio by slicing the image accordingly. For this to happen,preserveAspectRatio=”none slice” should be added to the <svg>like so: <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 149 50" enable-background="new 0 0 149 50" xml:space="preserve" preserveAspectRatio="none slice"> Save the file and try refreshing the page in Internet Explorer 10. You should see your image beautifully repeated now.

Parsing html as PHP Using Apache

You could add the following code to your Apache config file inside of  <IfModule mime_module> tag: AddType application/x-httpd-php5 .html .htm If you need to support other file types, like “..xml”, simply add them to the list, like this: AddType application/x-httpd-php5 .html.xml The entire text should look like this. <IfModule mime_module> AddType application/x-httpd-php .php </IfModule> Also, you could add the same line of code, anywhere inside your .htaccess file.

Old Virtual Host Configuration Access Forbidden Error 403 (XAMPP)

This was frustrating until I realized some of the configuration options I have been using for so long when configuring a virtual host in my local machine have been deprecated. Adding one line of code did the trick – Require all granted This is what I used to use:
<Directory "/websites/httpdocs/dummmy-website">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
And this is what I’m using now.
<Directory "/websites/httpdocs/eOpiates/website-dynamic/">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>

Apache Module mod_rewrite

Some things to remember when working with Apache module mod_rewrite and dynamic websites: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule>
  • <CondPattern‘ (lexicographically precedes) Treats the CondPattern as a plain string and compares it lexicographically to TestString. True if TestString lexicographically precedes CondPattern.
  • >CondPattern‘ (lexicographically follows) Treats the CondPattern as a plain string and compares it lexicographically to TestString. True if TestString lexicographically follows CondPattern.
  • =CondPattern‘ (lexicographically equal) Treats the CondPattern as a plain string and compares it lexicographically to TestString. True if TestString is lexicographically equal to CondPattern (the two strings are exactly equal, character for character). If CondPattern is "" (two quotation marks) this compares TestString to the empty string.
  • -d‘ (is directory) Treats the TestString as a pathname and tests whether or not it exists, and is a directory.
  • -f‘ (is regular file) Treats the TestString as a pathname and tests whether or not it exists, and is a regular file.
  • -s‘ (is regular file, with size) Treats the TestString as a pathname and tests whether or not it exists, and is a regular file with size greater than zero.
  • -l‘ (is symbolic link) Treats the TestString as a pathname and tests whether or not it exists, and is a symbolic link.
  • -F‘ (is existing file, via subrequest) Checks whether or not TestString is a valid file, accessible via all the server’s currently-configured access controls for that path. This uses an internal subrequest to do the check, so use it with care – it can impact your server’s performance!
  • -U‘ (is existing URL, via subrequest) Checks whether or not TestString is a valid URL, accessible via all the server’s currently-configured access controls for that path. This uses an internal subrequest to do the check, so use it with care – it can impact your server’s performance!