ia

Bank Nifty Prediction today – Nov 5, 2024: Might fall off a barrier, initiate short

Bank Nifty November futures areis likely to see a decline




ia

Aluminium futures: Potential rally ahead

The November futures can rise to ₹255




ia

Post mixed Q2, India Inc may face tailwinds in second half of FY25

It needs to be seen if fortunes for the consumer segments will reverse




ia

Inherit, initial, unset, revert

Today we’re going to take a quick look at a few special CSS keywords you can use on any CSS property: inherit, initial, revert, and unset. Also, we will ask where and when to use them to the greatest effect, and if we need more of those keywords.

The first three were defined in the Cascading Level 3 spec, while revert was added in Cascading Level 4. Despite 4 still being in draft revert is already supported. See also the MDN revert page, Chris Coyier’s page, and my test page

inherit

The inherit keyword explicitly tells an element that it inherits the value for this declaration from its parent. Let’s take this example:

.my-div {
	margin: inherit;
}

.my-div a {
	color: inherit;
}

The second declaration is easiest to explain, and sometimes actually useful. It says that the link colour in the div should be the same as the text colour. The div has a text colour. It’s not specified here, but because color is inherited by default the div gets the text color of its parent. Let’s say it’s black.

Links usually have a different colour. As a CSS programmer you frequently set it, and even if you don’t browsers automatically make it blue for you. Here, however, we explicitly tell the browsers that the link colour should be inherited from its parent, the div. In our example links become black.

(Is this a good idea? Occasionally. But if you remove the colour difference between links and main text, make sure your links are underlined. Your users will thank you.)

Now let’s look at the margin: inherit. Normally margins don’t inherit, and for good reason. The fact that an element has margin-left: 10% does not mean all of its descendents should also get that margin. In fact, you most likely don’t want that. Margins are set on a per-case basis.

This declaration tells the div to use the margin specified on its parent, however. This is an odd thing to specify, and I never saw a practical use case in the wild. Still CSS, being ridiculously powerful, allows it.

In any case, that’s how the inherit keyword works. Using it for font sizes or colours may occasionally be a good idea. In other contexts - rarely.

And keep the difference between inheriting and non-inheriting properties in mind. It’s going to be important later on.

initial

The initial keywords sets the property back to its initial value. This is the value specified in the W3C specification for that property.

Initial values from the spec are a bit of a mixed bag. Some make sense, others don’t, really. float: none and background-color: transparent are examples of the first category. Of course an element does not have a background colour without you specifying one, nor does it float automatically.

Others are historically determined, such as background-repeat: repeat. Back in the Stone Age before CSS all background images repeated, and the CSS1 specification naturally copied this behaviour.

Still others are essentially arbitrary, such as display: inline. Why did W3C opt for inline instead of block? I don’t know, and it doesn’t really matter any more. They had to decide on an initial value, and while inline is somewhat strange, block would be equally strange.

In any case, the initial keyword makes the property revert to this initial value from the specification, whether that makes sense or not.

unset

When we get to the unset value the distinction between inheriting and non-inheriting properties becomes important. unset has a different effect on them.

  • If a property is normally inherited, unset means inherit.
  • If a property is normally not inherited, unset means initial.

revert

revert, the newest of these keywords, also distinguishes between inheriting and non-inheriting properties.

  • If a property is normally inherited, revert means inherit.
  • If a property is normally not inherited, revert reverts to the value specified in the browser style sheet.

all

Finally, we should treat all. It is not a value but a property, or rather, the collection of all CSS properties on an element. It only takes one of the keywords we discussed, and allows you to apply that keyword to all CSS properties. For instance:

.my-div {
	all: initial;
}

Now all CSS properties on the div are set to initial.

Examples

The reaction of my test page to setting the display of all elements to the four keywords is instructive. My test script sets the following style:

body * {
	display: [inherit | initial | unset | revert] !important;
}

The elements react as follows:

  • display: inherit: all elements now inherit their display value from the body. Since the body has display: block all elements get that value, whether that makes sense or not.
  • display: initial: the initial value of display is inline. Therefore all elements get that value, whether that makes sense or not.
  • display: unset: display does not inherit. Therefore this behaves as initial and all elements get display: inline.
  • display: revert: display does not inherit. Therefore the defaults of the browser style sheet are restored, and each element gets its proper display — except for the dl, which I had given a display: grid. This value is now supplanted by the browser-provided block.

Unfortunately the same test page also contains a riddle I don’t understand the behaviour of <button>s when I set color to the four keywords:

  • color: inherit: all elements, including <button>s, now inherit their colour from the body, which is blue. So all text becomes blue.
  • color: initial: since the initial value of color is black, all elements, including <button>s, become black.
  • color: unset: color inherits. Therefore this behaves as inherit and all elements, including <button>s, become blue.
  • color: revert: This is the weird one. All elements become blue, except for <button>s, which become black. I don’t understand why. Since colors inherit, I expected revert to work as inherit and the buttons to also become blue. But apparently the browser style sheet of button {color: black} (more complicated in practice) is given precedence. Yes, revert should remove author styles (the ones we write), and that would cause the black from the browser style sheet to be applied, but only if a property does not inherit — and color does. I don’t know why the browser style sheet is given precedence in this case. So I’m going to cop out and say form elements are weird.

Practical use: almost none

The purpose of both unset and revert is to wipe the slate clean and return to the initial and the browser styles, respectively — except when the property inherits; in that case, inheritance is still respected. initial, meanwhile, wipes the slate even cleaner by also reverting inheriting properties to their initial values.

This would be useful when you create components that should not be influenced by styles defined elsewhere on the page. Wipe the slate clean, start styling from zero. That would help modularisation.

But that’s not how these keywords work. We don’t want to revert to the initial styles (which are sometimes plain weird) but to the browser style sheet. unset comes closest, but it doesn’t touch inherited styles, so it only does half of what we want.

So right now these keywords are useless — except for inherit in a few specific situations usually having to do with font sizes and colours.

New keyword: default

Chris Coyier argues we need a new value which he calls default. It reverts to the browser style sheet in all cases, even for inherited properties. Thus it is a stronger version of revert. I agree. This keyword would be actually useful. For instance:

.my-component,.my-component * {
	all: default;
	font-size: inherit;
	font-family: inherit;
	color: inherit;
}

Now we have a component that’s wiped clean, except that we decide to keep the fonts and colour of the main page. The rest is a blank slate that we can style as we like. That would be a massive boon to modularisation.

New keyword: cascade

For years now I have had the feeling that we need yet another keyword, which I’ll call cascade for now. It would mean “take the previous value in the cascade and apply it here.” For instance:

.my-component h2 {
	font-size: 24px;
}

.my-other-component h2 {
	font-size: 3em;
}

h2#specialCase {
	font-size: clamp(1vw,cascade,3vw)
}

In this (slightly contrived) example I want to clamp the font-size of a special h2 between 1vw and 3vw, with the preferred value being the one defined for the component I’m working in. Here, cascade would mean: take the value the cascade would deliver if this rule didn’t exist. This would make the clamped font size use either 24px or 3em as its preferred value, depending on which component we’re in.

The problem with this example is that it could also use custom properties. Just set --h2size to either 24px or 3em, use it in the clamp, and you’re done.

.my-component h2 {
	--h2size: 24px;
	font-size: var(--h2size);
}

.my-other-component h2 {
	--h2size: 3em;
	font-size: var(--h2size);
}

h2#specialCase {
	font-size: clamp(1vw,var(--h2size),3vw)
}

Still, this is but the latest example I created. I have had this thought many, many times, but because I didn’t keep track of my use cases I’m not sure if all of them could be served by custom properties.

Also, suppose you inherit a very messy CSS code base with dozens of components written at various skill levels. In that case adding custom properties to all components might be impractical, and the cascade keyword might help.

Anyway, I barely managed to convince myself, so professional standard writers will certainly not be impressed. Still, I thought I’d throw it out here to see if anyone else has a use case for cascade that cannot be solved with custom properties.



  • CSS for JavaScripters

ia

Rana Daggubati’s Spirit Media to launch ‘Hiranyakashyap’ movie, ‘Minnal Murali’ comic and more at San Diego Comic-Con 2023

Actor-producer Rana Daggubati’s Spirit Media debuts at San Diego Comic-Con 2023 by announcing the mythological film ‘Hiranyakashyap’ and comic based on the superhero film ‘Minnal Murali’ 




ia

Bengaluru-Mysuru expressway was opened in haste, says CM Siddaramaiah




ia

NIA arrests man from Hyderabad in connection with terror module 




ia

A newly-opened pizzeria brings Kundapuri ghee roast paneer and Kerala chicken roast flavours in pizzas

Dollops of sherry leek or fresh arugula? Choose your pick from artisanal pizzas and sauces made from scratch at the newly-opened pizzeria




ia

A curriculum shove at ISB focuses on a leadership model based on ancient Indian wisdom

Sharing an insight into the concept of ‘Beingful leadership’, Ram Nidumolu holds forth on how ancient wisdom models inform this futuristic concept and are relevant to modern managers



  • Life &amp; Style

ia

Library rooted in Gandhian principles turns a boon to book lovers in Andhra Pradesh

Home to over 35,000 books on various subjects, the Sarada Grandhalaya at Anakapalle has been serving society for over eight decades




ia

India’s first fuel outlet operated by woman convicts inaugurated in Chennai

About 30 woman prisoners will be employed in this petrol outlet in day shift and about 17 men prisoners on the night shift with a salary of ₹6,000 a month




ia

Parental behaviour closely associated with adolescents’ excessive Internet use, finds NIMHANS study

The study showed that decreased care and increased control from the mother, high autonomy from father and increased rejection from both parents as risk factors associated with adolescent internet excessive use




ia

‘Tiger Nageswara Rao’ teaser: Ravi Teja aims for pan India reach

Actor Ravi Teja’s Telugu movie ‘Tiger Nageswara Rao’, narrating the story of a thief from Stuartpuram, will also release in Tamil, Kannada, Malayalam and Hindi




ia

Pedestrian killed in Bengaluru




ia

‘Bedurulanka 2012’ movie review: A quirky social satire that’s partly amusing, partly patience testing

Written and directed by first-timer Clax, the Telugu dramedy ‘Bedurulanka 2012,’ starring Kartikeya Gummakonda and Neha Shetty, is an indie-spirited narrative that’s delightful in parts 




ia

Director Shiva Nirvana: ‘Kushi’ will discuss something beyond post-marriage romance, which we have not revealed in the trailer

Ahead of the release of Vijay Deverakonda and Samantha Ruth Prabhu’s ‘Kushi’, director Shiva Nirvana opens up on the Mani Ratnam influence and how he was never inclined to direct romances initially




ia

Allu Arjun offers a glimpse Of ‘Pushpa 2’ on Instagram’s official account 

Actor Allu Arjun invited Instagram to the sets of his forthcoming Telugu film ‘Pushpa: The Rule’, directed by Sukumar




ia

World Tourism Day: Discover cities in India through performance arts

Engage in Tamil kuthu in Chennai, hip-hop in Hyderabad, movement therapy in Bengaluru or Latin folk dance in Kochi. Dancescapes presents a city through performance art curated experiences



  • Life &amp; Style

ia

Finally, no longer Mother India

What a relief now to watch mothers on screen trying not to paint a picture of maternal perfection




ia

First International Calligraphy Festival of Kerala under way in Kochi is a hit with enthusiasts and fine arts students

Exhibition serves as an introduction to the potential of the art form which is gaining popularity among young artists in State




ia

The locals of Parengtar, a village on India-Bhutan border, are reviving the ancient practice of Kholey Dai

The third edition of community-driven, zero-waste Kholey Dai Harvest and Music Festival in Kalimpong’s Parengtar village puts the spotlight on the region’s Rai people and their love for paddy fields, music and dance



  • Life &amp; Style

ia

Bespoke wildlife luxury experiences in India for the New Year

Bespoke luxury experiences in the wild are offering travellers a lot more than just tiger spotting




ia

Airports to ensure Digi Yatra registration is voluntary and consensual: Scindia

The Aviation Minister’s comments followed complaints from passengers about forceful collection of personal data at airports




ia

Birders in Visakhapatnam report a drop in number of species during the Asian Waterbird Census

Habitat destruction, poaching and landfills near water sources are some of major threats faced by wetlands and birds in and around it in Visakhapatnam




ia

The AlUla trump card | How Saudi Arabia is reopening the Incense Road

Immersive museums, historic digs and a heterogeneous workforce are helping pave the way as Saudi Arabia pivots from a carbon-based economy to a culture-focused one




ia

Women’s Day 2024: Experience safe travel in India through women-only travel groups

Step into the world of women-only travel groups, where like-minded adventurers come together to build lasting connections, and embark on unforgettable journeys




ia

Spanish woman gang rape case: Crimes against foreigners in India rarely result in convictions | Data

Approximately, one in twenty rape cases in which victims are foreigners results in convictions




ia

Explore India’s wild side with these luxury wildlife safaris

Private safaris, bush dinners, and forest spas... step into a place that time forgot. Here is how to experience India’s wildlife in style   




ia

What India’s Jewish buildings have to say

Jewish-origin architecture in the country appears to advocate a community-led way of life. What’s unique is that the restoration and adaptive reuse of synagogues, hospitals and houses is often funded by people of other faiths



  • History &amp; Culture

ia

Explore India : Five incredible holiday experiences

Be it the magnificent landscapes that are rich in flora and fauna or the diverse and vibrant heritage and culture that the country boasts, India has something in store for every traveller. Here is a curated list of some of the incredible experiences one can have in India. Pick the ones you want to experience during your holidays. 




ia

Explore the hidden frontiers of Arabia with Reza Pakravan

In this new show, Reza Pakravan claims to show viewers never-before-seen caves and canyons in Arabia




ia

South Asia’s highest ‘land art’ festival set in Ladakh reflects on climate change

Art at an altitude of 3,500 metres? South Asia’s highest contemporary land art festival is back with its second edition in Ladakh with site-specific installations and sustainable sculptures



  • Life &amp; Style

ia

Scholars, historians on a mission to illuminate Srikakulam’s forgotten heritage

While Buddhist structures in Dantapuri near Amadalavalasa have suffered damage, the Salihundam structure near Gara remains largely in good shape, thanks to initiatives taken by the Archaeological Survey of India and Tourism department




ia

Scoot begins air services from Singapore to Malaysia’s Sibu

The company is operating three weekly flights with a maximum seating capacity of 112 passengers from the Asian financial hub to the city on Borneo Island




ia

Why you should ditch touristy holiday destinations for Sibu — Malaysia’s quaint city on Borneo Island

Nearly 60 kilometres from the South China Sea, this city in Borneo offers a variety of traditional cuisines




ia

Exploring the rise of sports tourism in India: The journey beyond the game

Indian sports tourism is surging, with many heading to the Paris Olympics for a blend of athletic thrills and cultural experiences




ia

Here’s why private flights are taking off in India like never before

Once the domain of politicians and Bollywood celebrities, private flights are catching the fancy of India’s ultra rich who prize their exclusivity and speed. How much will it cost you to hop aboard?



  • Life &amp; Style

ia

An Indian stargazing guide: From Ladakh to Pench

TheAstro-tourismscene in India is rapidly expanding beyond the borders of Ladakh and Uttarakhand. Join us as we look up at the night sky in Pench, Nagaland and the Andamans




ia

India’s first Voco Hotel in Jim Corbett offers many surprises beyond the tiger trail

The romance of the mountain rains, fragrance of the forest and petrichor, a symphony by sung by the birds and a taste of Kumaoni cuisine and cocktail, that’s how India’s first Voco Hotel in Jim Corbett invites you to live in the moment




ia

AIADMK leader seeks DCGI action on spurious drugs




ia

AIADMK flays Speaker for flouting parliamentary conventions and rules




ia

Transfer and posting of IAS officers




ia

Recent cases against Puducherry officials “validate” our charges against AINRC-BJP govt, says former CM Narayanasamy

Three senior officials belonging to Puducherry Civil Services cadre have been arrested in temple land scams in the recent months




ia

Govt to provide 10 essential items at a subsidised rate through CONFED in Puducherry




ia

Lt. Governor urges industry associations to set up SC/ST cell to assist socially marginalised sections to start ventures




ia

AIADMK demands setting up of CBI unit in Puducherry




ia

Conclave on Indian Knowledge Systems




ia

Judiciary has played a key role in ‘shaping and reshaping’ Indian society: Puducherry L-G

Speaking at the South India Conference (Puducherry) of the All India Advocate’s Federation in the Union Territory, the L-G said the judiciary is the cornerstone of India’s democracy. 




ia

New high-level bridge near Villianur open to traffic




ia

Revision of electoral roll begins, special camp dates announced