about

Interesting fact about Ranveer's film '83'

Ranveer Singh and Deepika Padukone's sports drama 83 which is directed by Kabir Khan revolves around the true story of India's incredible cricket World Cup victory in 1983.




about

'We should not think just about ourselves'

'Every morning, when I had to step out, my wife would cry.'




about

5 Things You Didn't Know About Irrfan

Aseem Chhabra introduces you to the Irrfan you never knew.




about

Ten great ideas about chance [electronic resource] / Persi Diaconis, Brian Skyrms.

Princeton, New Jersey : Princeton University Press, [2018]




about

Smart business: what Alibaba's success reveals about the future of strategy / Ming Zeng

Dewey Library - HD30.28.Z425 2018






about

Covid-19: Migrant workers gather at Mangaluru railway station following rumours about special trains

Karnataka Revenue Minister R Ashok said the government was awaiting consent from other states to send the migrant workers home.




about

Here’s what we know (and don’t know) about asymptomatic Covid-19 patients

A physician answers five common questions.




about

Samit Basu’s new novel looks at how reality is shaped and what humans can do about it

‘Chosen Spirits’ is neither simple dystopic science-fiction nor straightforward political satire, but a call for freedom in an age of puppy adoption shows.




about

Insights About the Transition System for SSI Youth from the National Evaluation of Promoting Readiness of Minors in SSI (PROMISE)

This article discusses insights gained from the national PROMISE evaluation about the current transition system, which are relevant to current initiatives supporting youth with disabilities during the transition to adulthood.




about

No visible bruises: what we don't know about domestic violence can kill us / Rachel Louise Snyder

Dewey Library - HV6626.2.S59 2019




about

Race on the brain: what implicit bias gets wrong about the struggle for racial justice / Jonathan Kahn

Dewey Library - HV9950.K34 2018




about

What we talk about when we talk about rape / Sohaila Abdulali

Hayden Library - HV6558.A295 2018




about

False alarm: the truth about political mistruths in the Trump era / Ethan Porter, Thomas J. Wood

Dewey Library - JK1726.P67 2019




about

The first: how to think about hate speech, campus speech, religious speech, fake news, post-truth, and Donald Trump / Stanley Fish

Dewey Library - JC591.F56 2019




about

Mumbai gets new swanky addresses, but nothing official about it

Developers' new strategy to beat grim market mood, sell luxury residential projects at premium.




about

10 things you should know about Rahul Gandhi's speech in Punjab

Addressing the gathering, Rahul Gandhi raked up the issue of drug menace in Punjab.




about

Centre had alerted Bihar govt about threat to Modi rally: BJP

The opposition party accused the state government of adopting a "casual and callous" attitude.




about

Tales of an ecotourist : what travel to wild places can teach us about climate change / Mike Gunter Jr

Gunter, Michael M., 1969- author




about

What we know about climate change / Kerry Emanuel ; with a new foreword by Bob Inglis

Emanuel, Kerry A., 1955- author




about

TMC General Secretary Mukul Roy rubbishes reports about forming new party



  • DO NOT USE West Bengal
  • India

about

Mamata snaps back at media when asked about businessman’s detention



  • DO NOT USE West Bengal
  • India

about

Covid-19: Central team asks State about frontline staff, quarantine facilities

A.P. is ahead of other states with regard to testing capacity, Medical and Health Commissioner Katamaneni Bhaskar said the government was taking measures to contain the spread of the virus




about

Central team enquires about frontline workers who contracted COVID-19

It also seeks details of paid quarantine facilities and death rate




about

JSJ 429: Learning about Postman with Joyce Lin

JavaScript Remote Conf 2020

May 13th to 15th - register now!

Join us as we talk to Joyce Lin, a developer relations advocate with Postman, and we talk about this amazing tool for interacting with APIs. We discuss it’s more well-known features, and also learn about other less well known, but very powerful features that allow users to greatly increase the usefulness of the tool, both for front end and back end developers.

Panel

  • Aimee Knight
  • Steve Edwards

Guest

  • Joyce Lin

Sponsors

____________________________________________________________

"The MaxCoders Guide to Finding Your Dream Developer Job" by Charles Max Wood is now available on Amazon. Get Your Copy Today!

____________________________________________________________

Links

Picks

Steve Edwards:

Joyce Lin:

Follow JavaScript Jabber on Twitter > @JSJabber




about

Your rights at work [electronic resource] : all you need to know about workplace law, and how to use it to protect your job / by Richard C. Busse

Busse, Richard C




about

You're addicted to you [electronic resource] : why it's so hard to change--and what you can do about it / Noah Blumenthal

Blumenthal, Noah, 1972-




about

About normalize.css

Normalize.css is a small CSS file that provides better cross-browser consistency in the default styling of HTML elements. It’s a modern, HTML5-ready, alternative to the traditional CSS reset.

Normalize.css is currently used in some form by Twitter Bootstrap, HTML5 Boilerplate, GOV.UK, Rdio, CSS Tricks, and many other frameworks, toolkits, and sites.

Overview

Normalize.css is an alternative to CSS resets. The project is the product of 100’s of hours of extensive research by @necolas and @jon_neal on the differences between default browser styles.

The aims of normalize.css are as follows:

  • Preserve useful browser defaults rather than erasing them.
  • Normalize styles for a wide range of HTML elements.
  • Correct bugs and common browser inconsistencies.
  • Improve usability with subtle improvements.
  • Explain the code using comments and detailed documentation.

It supports a wide range of browsers (including mobile browsers) and includes CSS that normalizes HTML5 elements, typography, lists, embedded content, forms, and tables.

Despite the project being based on the principle of normalization, it uses pragmatic defaults where they are preferable.

Normalize vs Reset

It’s worth understanding in greater detail how normalize.css differs from traditional CSS resets.

Normalize.css preserves useful defaults

Resets impose a homogenous visual style by flattening the default styles for almost all elements. In contrast, normalize.css retains many useful default browser styles. This means that you don’t have to redeclare styles for all the common typographic elements.

When an element has different default styles in different browsers, normalize.css aims to make those styles consistent and in line with modern standards when possible.

Normalize.css corrects common bugs

It fixes common desktop and mobile browser bugs that are out of scope for resets. This includes display settings for HTML5 elements, correcting font-size for preformatted text, SVG overflow in IE9, and many form-related bugs across browsers and operating systems.

For example, this is how normalize.css makes the new HTML5 search input type cross-browser consistent and stylable:

/**
 * 1. Addresses appearance set to searchfield in S5, Chrome
 * 2. Addresses box-sizing set to border-box in S5, Chrome (include -moz to future-proof)
 */

input[type="search"] {
  -webkit-appearance: textfield; /* 1 */
  -moz-box-sizing: content-box;
  -webkit-box-sizing: content-box; /* 2 */
  box-sizing: content-box;
}

/**
 * Removes inner padding and search cancel button in S5, Chrome on OS X
 */

input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

Resets often fail to bring browsers to a level starting point with regards to how an element is rendered. This is particularly true of forms – an area where normalize.css can provide some significant assistance.

Normalize.css doesn’t clutter your debugging tools

A common irritation when using resets is the large inheritance chain that is displayed in browser CSS debugging tools.

A common sight in browser debugging tools when using a CSS reset

This is not such an issue with normalize.css because of the targeted styles and the conservative use of multiple selectors in rulesets.

Normalize.css is modular

The project is broken down into relatively independent sections, making it easy for you to see exactly which elements need specific styles. Furthermore, it gives you the potential to remove sections (e.g., the form normalizations) if you know they will never be needed by your website.

Normalize.css has extensive documentation

The normalize.css code is based on detailed cross-browser research and methodical testing. The file is heavily documented inline and further expanded upon in the GitHub Wiki. This means that you can find out what each line of code is doing, why it was included, what the differences are between browsers, and more easily run your own tests.

The project aims to help educate people on how browsers render elements by default, and make it easier for them to be involved in submitting improvements.

How to use normalize.css

First, install or download normalize.css from GitHub. There are then 2 main ways to make use of it.

Approach 1: use normalize.css as a starting point for your own project’s base CSS, customising the values to match the design’s requirements.

Approach 2: include normalize.css untouched and build upon it, overriding the defaults later in your CSS if necessary.

Closing comments

Normalize.css is significantly different in scope and execution to CSS resets. It’s worth trying it out to see if it fits with your development approach and preferences.

The project is developed in the open on GitHub. Anyone can report issues and submit patches. The full history of the project is available for anyone to see, and the context and reasoning for all changes can be found in the commit messages and the issue threads.

Detailed information on default UA styles: WHATWG suggestions for rendering HTML documents, Internet Explorer User Agent Style Sheets,and CSS2.1 User Agent Style Sheet Defaults.

Translations




about

About HTML semantics and front-end architecture

A collection of thoughts, experiences, ideas that I like, and ideas that I have been experimenting with over the last year. It covers HTML semantics, components and approaches to front-end architecture, class naming patterns, and HTTP compression.

About semantics

Semantics is the study of the relationships between signs and symbols and what they represent. In linguistics, this is primarily the study of the meaning of signs (such as words, phrases, or sounds) in language. In the context of front-end web development, semantics are largely concerned with the agreed meaning of HTML elements, attributes, and attribute values (including extensions like Microdata). These agreed semantics, which are usually formalised in specifications, can be used to help programmes (and subsequently humans) better understand aspects of the information on a website. However, even after formalisation, the semantics of elements, attributes, and attribute values are subject to adaptation and co-option by developers. This can lead to subsequent modifications of the formally agreed semantics (and is an HTML design principle).

Distinguishing between different types of HTML semantics

The principle of writing “semantic HTML” is one of the foundations of modern, professional front-end development. Most semantics are related to aspects of the nature of the existing or expected content (e.g. h1 element, lang attribute, email value of the type attribute, Microdata).

However, not all semantics need to be content-derived. Class names cannot be “unsemantic”. Whatever names are being used: they have meaning, they have purpose. Class name semantics can be different to those of HTML elements. We can leverage the agreed “global” semantics of HTML elements, certain HTML attributes, Microdata, etc., without confusing their purpose with those of the “local” website/application-specific semantics that are usually contained in the values of attributes like the class attribute.

Despite the HTML5 specification section on classes repeating the assumed “best practice” that…

…authors are encouraged to use [class attribute] values that describe the nature of the content, rather than values that describe the desired presentation of the content.

…there is no inherent reason to do this. In fact, it’s often a hindrance when working on large websites or applications.

  • Content-layer semantics are already served by HTML elements and other attributes.
  • Class names impart little or no useful semantic information to machines or human visitors unless it is part of a small set of agreed upon (and machine readable) names – Microformats.
  • The primary purpose of a class name is to be a hook for CSS and JavaScript. If you don’t need to add presentation and behaviour to your web documents, then you probably don’t need classes in your HTML.
  • Class names should communicate useful information to developers. It’s helpful to understand what a specific class name is going to do when you read a DOM snippet, especially in multi-developer teams where front-enders won’t be the only people working with HTML components.

Take this very simple example:

<div class="news">
    <h2>News</h2>
    [news content]
</div>

The class name news doesn’t tell you anything that is not already obvious from the content. It gives you no information about the architectural structure of the component, and it cannot be used with content that isn’t “news”. Tying your class name semantics tightly to the nature of the content has already reduced the ability of your architecture to scale or be easily put to use by other developers.

Content-independent class names

An alternative is to derive class name semantics from repeating structural and functional patterns in a design. The most reusable components are those with class names that are independent of the content.

We shouldn’t be afraid of making the connections between layers clear and explicit rather than having class names rigidly reflect specific content. Doing this doesn’t make classes “unsemantic”, it just means that their semantics are not derived from the content. We shouldn’t be afraid to include additional HTML elements if they help create more robust, flexible, and reusable components. Doing so does not make the HTML “unsemantic”, it just means that you use elements beyond the bare minimum needed to markup the content.

Front-end architecture

The aim of a component/template/object-oriented architecture is to be able to develop a limited number of reusable components that can contain a range of different content types. The important thing for class name semantics in non-trivial applications is that they be driven by pragmatism and best serve their primary purpose – providing meaningful, flexible, and reusable presentational/behavioural hooks for developers to use.

Reusable and combinable components

Scalable HTML/CSS must, by and large, rely on classes within the HTML to allow for the creation of reusable components. A flexible and reusable component is one which neither relies on existing within a certain part of the DOM tree, nor requires the use of specific element types. It should be able to adapt to different containers and be easily themed. If necessary, extra HTML elements (beyond those needed just to markup the content) and can be used to make the component more robust. A good example is what Nicole Sullivan calls the media object.

Components that can be easily combined benefit from the avoidance of type selectors in favour of classes. The following example prevents the easy combination of the btn component with the uilist component. The problems are that the specificity of .btn is less than that of .uilist a (which will override any shared properties), and the uilist component requires anchors as child nodes.

.btn { /* styles */ }
.uilist { /* styles */ }
.uilist a { /* styles */ }
<nav class="uilist">
    <a href="#">Home</a>
    <a href="#">About</a>
    <a class="btn" href="#">Login</a>
</nav>

An approach that improves the ease with which you can combine other components with uilist is to use classes to style the child DOM elements. Although this helps to reduce the specificity of the rule, the main benefit is that it gives you the option to apply the structural styles to any type of child node.

.btn { /* styles */ }
.uilist { /* styles */ }
.uilist-item { /* styles */ }
<nav class="uilist">
    <a class="uilist-item" href="#">Home</a>
    <a class="uilist-item" href="#">About</a>
    <span class="uilist-item">
        <a class="btn" href="#">Login</a>
    </span>
</nav>

JavaScript-specific classes

Using some form of JavaScript-specific classes can help to reduce the risk that thematic or structural changes to components will break any JavaScript that is also applied. An approach that I’ve found helpful is to use certain classes only for JavaScript hooks – js-* – and not to hang any presentation off them.

<a href="/login" class="btn btn-primary js-login"></a>

This way, you can reduce the chance that changing the structure or theme of components will inadvertently affect any required JavaScript behaviour and complex functionality.

Component modifiers

Components often have variants with slightly different presentations from the base component, e.g., a different coloured background or border. There are two mains patterns used to create these component variants. I’m going to call them the “single-class” and “multi-class” patterns.

The “single-class” pattern

.btn, .btn-primary { /* button template styles */ }
.btn-primary { /* styles specific to save button */ }

<button class="btn">Default</button>
<button class="btn-primary">Login</button>

The “multi-class” pattern

.btn { /* button template styles */ }
.btn-primary { /* styles specific to primary button */ }

<button class="btn">Default</button>
<button class="btn btn-primary">Login</button>

If you use a pre-processor, you might use Sass’s @extend functionality to reduce some of the maintenance work involved in using the “single-class” pattern. However, even with the help of a pre-processor, my preference is to use the “multi-class” pattern and add modifier classes in the HTML.

I’ve found it to be a more scalable pattern. For example, take the base btn component and add a further 5 types of button and 3 additional sizes. Using a “multi-class” pattern you end up with 9 classes that can be mixed-and-matched. Using a “single-class” pattern you end up with 24 classes.

It is also easier to make contextual tweaks to a component, if absolutely necessary. You might want to make small adjustments to any btn that appears within another component.

/* "multi-class" adjustment */
.thing .btn { /* adjustments */ }

/* "single-class" adjustment */
.thing .btn,
.thing .btn-primary,
.thing .btn-danger,
.thing .btn-etc { /* adjustments */ }

A “multi-class” pattern means you only need a single intra-component selector to target any type of btn-styled element within the component. A “single-class” pattern would mean that you may have to account for any possible button type, and adjust the selector whenever a new button variant is created.

Structured class names

When creating components – and “themes” that build upon them – some classes are used as component boundaries, some are used as component modifiers, and others are used to associate a collection of DOM nodes into a larger abstract presentational component.

It’s hard to deduce the relationship between btn (component), btn-primary (modifier), btn-group (component), and btn-group-item (component sub-object) because the names don’t clearly surface the purpose of the class. There is no consistent pattern.

In early 2011, I started experimenting with naming patterns that help me to more quickly understand the presentational relationship between nodes in a DOM snippet, rather than trying to piece together the site’s architecture by switching back-and-forth between HTML, CSS, and JS files. The notation in the gist is primarily influenced by the BEM system‘s approach to naming, but adapted into a form that I found easier to scan.

Since I first wrote this post, several other teams and frameworks have adopted this approach. MontageJS modified the notation into a different style, which I prefer and currently use in the SUIT framework:

/* Utility */
.u-utilityName {}

/* Component */
.ComponentName {}

/* Component modifier */
.ComponentName--modifierName {}

/* Component descendant */
.ComponentName-descendant {}

/* Component descendant modifier */
.ComponentName-descendant--modifierName {}

/* Component state (scoped to component) */
.ComponentName.is-stateOfComponent {}

This is merely a naming pattern that I’m finding helpful at the moment. It could take any form. But the benefit lies in removing the ambiguity of class names that rely only on (single) hyphens, or underscores, or camel case.

A note on raw file size and HTTP compression

Related to any discussion about modular/scalable CSS is a concern about file size and “bloat”. Nicole Sullivan’s talks often mention the file size savings (as well as maintenance improvements) that companies like Facebook experienced when adopting this kind of approach. Further to that, I thought I’d share my anecdotes about the effects of HTTP compression on pre-processor output and the extensive use of HTML classes.

When Twitter Bootstrap first came out, I rewrote the compiled CSS to better reflect how I would author it by hand and to compare the file sizes. After minifying both files, the hand-crafted CSS was about 10% smaller than the pre-processor output. But when both files were also gzipped, the pre-processor output was about 5% smaller than the hand-crafted CSS.

This highlights how important it is to compare the size of files after HTTP compression, because minified file sizes do not tell the whole story. It suggests that experienced CSS developers using pre-processors don’t need to be overly concerned about a certain degree of repetition in the compiled CSS because it can lend itself well to smaller file sizes after HTTP compression. The benefits of more maintainable “CSS” code via pre-processors should trump concerns about the aesthetics or size of the raw and minified output CSS.

In another experiment, I removed every class attribute from a 60KB HTML file pulled from a live site (already made up of many reusable components). Doing this reduced the file size to 25KB. When the original and stripped files were gzipped, their sizes were 7.6KB and 6KB respectively – a difference of 1.6KB. The actual file size consequences of liberal class use are rarely going to be worth stressing over.

How I learned to stop worrying…

The experience of many skilled developers, over many years, has led to a shift in how large-scale website and applications are developed. Despite this, for individuals weaned on an ideology where “semantic HTML” means using content-derived class names (and even then, only as a last resort), it usually requires you to work on a large application before you can become acutely aware of the impractical nature of that approach. You have to be prepared to disgard old ideas, look at alternatives, and even revisit ways that you may have previously dismissed.

Once you start writing non-trivial websites and applications that you and others must not only maintain but actively iterate upon, you quickly realise that despite your best efforts, your code starts to get harder and harder to maintain. It’s well worth taking the time to explore the work of some people who have proposed their own approaches to tackling these problems: Nicole’s blog and Object Oriented CSS project, Jonathan Snook’s Scalable Modular Architecture CSS, and the Block Element Modifier method that Yandex have developed.

When you choose to author HTML and CSS in a way that seeks to reduce the amount of time you spend writing and editing CSS, it involves accepting that you must instead spend more time changing HTML classes on elements if you want to change their styles. This turns out to be fairly practical, both for front-end and back-end developers – anyone can rearrange pre-built “lego blocks”; it turns out that no one can perform CSS-alchemy.




about

The truth about getting the best from people [electronic resource] / Martha I. Finney

Finney, Martha I




about

The truth about leading teams [electronic resource] : the essential truths in 20 minutes / by Martha I. Finney

Finney, Martha I




about

The truth about making complex or critical decisions [electronic resource] : the essential truths in 20 minutes / Robert E. Gunther

Gunther, Robert E., 1960- author




about

The truth about managing effectively (collection) [electronic resource] / Cathy Fyock [and three others]

Fyock, Catherine D., author




about

The truth about managing people [electronic resource] : proven insights to get the best from your team / Stephen P. Robbins

Robbins, Stephen P., 1943- author




about

The truth about motivating your employees [electronic resource] : the essential truths in 20 minutes / Martha I. Finney

Finney, Martha I., author




about

What every leader should know about expatriate effectiveness [electronic resource] / Meena S. Wilson, Maxine A. Dalton

Wilson, Meena S., author




about

The wonderful, horrible truth about Agile [electronic resource] / Matt LeMay

LeMay, Matt, author





about

What Flushing Toilets Taught Me About Web Design

I re-learned an old design lesson from the humble toilet flusher. As new features are added to existing technologies, careful design is required to make their usage clear.




about

Di kebun binatang [kit] : a story about animals




about

Pauling's rules about crystal structures flunk test

Only 13 % of oxide crystal structures obey 4 of the 5 rules simultaneously




about

Pauling's rules about crystal structures flunk test

Only 13% of oxide crystal structures obey 4 of the 5 rules simultaneously




about

Sarah Richardson on prestige publishing: &#8216;Luckily, I don't give a crap about that'

Her company, MicroByre, is proving that wild microbes can be engineered to produce useful chemicals




about

What can initial remdesivir data tell us about tackling COVID-19?

Gilead Sciences' antiviral is in multiple late-stage trials to treat coronavirus infections. Don't expect a home run, say infectious disease experts




about

What do we know about the novel coronavirus's 29 proteins?

These biomolecules could hold clues to why the virus is so infectious and to how to stop it




about

US EPA should tell people about ethylene oxide risks promptly, internal watchdog says

Inspector general finds agency hasn't reached out to those living near 9 chemical plants




about

US EPA should tell people about ethylene oxide risks promptly, internal watchdog says

Inspector general finds agency hasn't reached out to those living near 9 chemical plants




about

What do we know about the novel coronavirus's 29 proteins?

These biomolecules could hold clues to why the virus is so infectious and how to stop it




about

Cancer risk studies raise questions about the safety of long-lasting hair dyes

Long-lasting hair dyes are popular, and their safety has been well researched. But new epidemiology studies show their use correlates with increased risk of breast cancer