Johnny's Renowned Style Names Discover Johnny's Stylish Names Johnny's Unique Name Styles

By Thomas

In the ever-evolving realm of web development, consistency is key when it comes to naming conventions. One such convention that has gained significant traction is the 'Johnny Style', named after its creator, 'Johnathan Snook'. But what exactly is Johnny Style, and why has it become a popular choice among developers?

the word johnny written in black ink on a white background
the word johnny written in black ink on a white background

Also known as BEM (Block, Element, Modifier), Johnny Style is a URL-friendly naming convention for classes that organizes code for better understanding and maintainability. It was first introduced to the web development community in 2014, and since then, it has been widely adopted and praised for its simplicity and effectiveness.

the word johnny written in black on a white background
the word johnny written in black on a white background

Understanding Johnny Style

At its core, Johnny Style breaks down the structure of a web page into three categories: Blocks, Elements, and Modifiers. Each category has its own prefix that distinguishes its role within the codebase.

the word johnny written in cursive writing with a heart on it's side
the word johnny written in cursive writing with a heart on it's side

However, before delving into the details, it's crucial to understand that Johnny Style, like any other naming convention, is not sacred. It's merely a tool designed to aid in code organization and understanding, and its value lies in its ability to promote consistency and conformance among developers.

Blocks

the word johnny written in black ink
the word johnny written in black ink

A 'Block' in Johnny Style represents a standalone entity within the page's structure. It could be anything from a header, a footer, or even a button. The naming format for Blocks is '`.block-name`' e.g., '`.header`' or '`.footer`'.

For instance, a 'Button' can be represented as a Block like so: `

`. However, it's essential to note that a Block should be used sparingly and should only be done when the element has a unique standalone purpose.

Elements

the word johnny written in white ink on a black background
the word johnny written in white ink on a black background

Elements, on the other hand, represent a child or a component of a Block. They are nested under their parent Block and are represented with a '`--`' (double dash) before the Element name. For example, elements of a '`.button`' Block could be '`.button--label`' or '`.button--icon`'.

Taking the above 'Button' example, the label and icon components of a button would be represented as: `

Button
` and `
☰
` respectively.

Applying Johnny Style

Johnny Name Tattoo Designs
Johnny Name Tattoo Designs

Now that we have an understanding of what Blocks and Elements are in Johnny Style, let's look at how they are used in a more complex scenario, such as a debatable 'Major Primary Button'.

The Button Block would be represented as '`.button`', while its Modifier '`.major`' would be represented separately. Therefore, a primary major button would look something like this: `

Button
`

the word johnny written in cursive writing
the word johnny written in cursive writing
the word johnny written in black ink
the word johnny written in black ink
the word jhonny written in black on a white background
the word jhonny written in black on a white background
JH.
JH.
Free Name Design ART TEXT
Free Name Design ART TEXT
the word johnny written in black on a white background
the word johnny written in black on a white background
*•.  쟈니.’ yutephy
*•. 쟈니.’ yutephy
the word johnny written in blue ink on a white background
the word johnny written in blue ink on a white background
the word johnny written in cursive writing with black ink on a white background
the word johnny written in cursive writing with black ink on a white background
the word johnny written in black ink
the word johnny written in black ink

Modifiers

Modifiers, as the name suggests, change the appearance or behavior of an Element or a Block without interacting with its sources. They are represented by '--' followed by the Modifier's name, e.g., '`.button--major`'.

Modifiers are allowed to modify as many Elements or Blocks as an application has, as long as they are consistent throughout the application.

Multiple Modifiers

In instances where a Block/Element has multiple Modifiers, JavaScript Object Notation (JSON) is used to represent them. The modifiers are separated by spaces, e.g., '`.button--major button--primary`'.

However, it's important to note that different browsers interpret Multiple Modifiers differently. Therefore, using them should be done with caution to avoid potential layout complications.

In essence, Johnny Style is a practical and efficient naming convention that has withstood the test of time. It caters to the dynamic needs of web development, promoting consistency and reducing redundancy in coding. However, like all naming conventions, Johnny Style is not absolute and should be adapted based on the project's specific needs.