ri

Crude Check: No clarity in trend

Traders can avoid new positions




ri

Niva Bupa Health Insurance IPO: Should you subscribe?

The company’s ability to reign in claims in the next three years is key monitorable




ri

Trump, tariffs and tax cuts – Can they power the US stock markets ahead?

As Trump 2.0 gets set to take control, the US markets are a play of opposing factors




ri

The right asset mix

You should reduce equity investments and increase bond investments starting five years from the end of the time horizon for a goal. You should, however, save more during this period.




ri

Nifty Prediction Today – November 11, 2024: Resistance ahead. Go short on a rise

Nifty 50 November Futures contract can fall to 23,900




ri

aspect-ratio and grid

I’m currently investigating the new aspect-ratio declaration and plan to write an article about it. However, I got stuck on aspect ratios in a grid context. Chrome/Safari and Firefox do something different here, and I understand neither approach. So I hope I can get some help.

aspect-ratio is currently supported by Chrome 90, by Firefox 88 with the correct flag enabled, and by Safari Technology Preview. I tested mostly in the first two — for complicated reasons I cannot install STP right now, but a kind Twitter follower sent me a few screenshots. It behaves as Chrome.

First, a general remark. aspect-ratio is intentionally a fairly weak declaration. It gives way if other constraints on boxes make the requested aspect ratio impossible. Take this example:

.my-box {
	width: 100px;
	height: 50px;
	aspect-ratio: 16/9;
}

The box has a fixed width and height, and they overrule the aspect-ratio. The box will thus have a 2/1 aspect ratio, as dictated by its width and height, and not a 16/9 one.

Flexbox

With that in mind, let’s first look at aspect-ratio in a flexbox environment. I think I understand what’s going on here, and the browsers all do the same, so this is a good reference point for the grid problems we’ll encounter later.

Flex items take their width from the flexbox environment. In my example they have a flex-basis: 30%, but they could also have a width or even no width/flex-basis definition at all. In all cases the flexbox algorithm decides on the width of each item.

Once the width has been determined, it’s time for the height. Let’s assume it’s not set. In flexbox, height: auto means not “as high as you need to be for your content” but “as high as the highest box in your row.”

That is, naturally flexbox would give the boxes an equal width (because that’s what my flex declarations say) and an equal height (because that always happens in flexbox). Apparently, this counts as a set height for the aspect-ratio algorithm.

As a result the 16/9 value is ignored because the 4/3 results in a larger height, and this value is therefore the one that determines the height of the entire row.

As you see, the third box in this example does have the correct aspect ratio. That’s because it has an explicit height: min-content: set your height to whatever your content needs, and, more importantly, ignore the row height of the flex box. This, apparently, gives the aspect ratio algorithm the opening it needs to set the height to the one requested by the aspect-ratio: 16/9.

I’m not sure if my reasoning is right. I am very certain that this works in all browsers, though, so you can use height: min-content in production straight away. (max-content also works. There’s no real difference between the two in height declarations.)

flex aspect-ratio and min-content

The problem: grid

Now we get to the problem: grid. To follow along, please look at the example below in Firefox 88 with the aspect-ratio flag on, and in either Chrome or Safari Technology Preview.

I expected grid to more or less behave the same as flexbox: the widths are set by the grid, the heights by the row height, and getting the proper aspect ratio would require height: min-content. That last clause is correct: the min-content trick works as it does in flexbox. It’s the behaviour of th 16/9 box without min-content that surprises me.

Here, again, the third box has height: min-content and takes the correct aspect ratio, which means not obeying the row height, in all browsers.

grid aspect-ratio and min-content

Firefox first. All boxes get their correct aspect ratio and they all have the same width, as the repeat: (3,1fr) grid template dictates. That means their height differs. More importantly, the grid container box now becomes only as high as is necessary to contain the items as they would have been without their aspect ratio.

I am 99% certain that the grid container behaviour is a bug. I am less certain whether the aspect-ratio being obeyed is also a bug.

In Chrome, the second and third box behave as expected: the last box becomes less high than the row height because of height: min-content, and the second box dictates the row height with its 4/3 aspect ratio.

But what’s up with the first box? It appears that it takes the row height as a given, but then sets the width to the value dictated by the 16/9 aspect ratio, ignoring the fact that this box now overflows its proper grid placement. Is this a bug? Or does height count for more than width in a grid context? I don’t know.

In the second example all grid items have min-height: 100px. In all browsers they they calculate their width from their aspect ratio. Thus they break the grid-defined widths. This is understandable, given that the explicit height declaration is “stronger” than the implied widths from the grid definition. (Or rather: I devoutly hope I’m right here and not talking nonsense.)

grid aspect-ratio and min-height: 100px;

Thus maybe Firefox on the one hand and Chrome/Safari on the other are not as far apart as one would think from the first grid example. Still, something is buggy in that example. I just can’t figure out what it is.

Stumped. Please help.



  • CSS for JavaScripters

ri

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

ri

Govt. hiding behind private firm instead of solving Dharani issues: Kishan Reddy




ri

Ruhani Sharma: I play a close-to-reality cop in ‘HER’; there is no scope for ‘Singham’ style of histrionics

Ruhani Sharma talks about headlining the Telugu cop drama franchise ‘HER’, says she never imagined herself as a sharpshooter 




ri

Director Sai Rajesh: ‘Baby’ has been a learning experience; henceforth I will be more cautious in my writing

Sai Rajesh, the writer-director of the Telugu romantic drama ‘Baby’ that has been eliciting extreme responses, says he did not intend to make a toxic film




ri

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’ 




ri

After a dull six months, Hostel Hudugaru Bekagiddare brings cheer to Kannada film industry

 After a memorable 2022, the industry suffered a slump in the first half of this year with only Daredevil Musthafa providing a consolation




ri

Carry out Uppal corridor repairs: BJP




ri

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




ri

Pulling strings for Tila

Based on German and Indian folk tales, Tila, a puppet play will be staged at Ranga Shankara from August 8




ri

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

ri

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




ri

Pedestrian killed in Bengaluru




ri

Govt to constitute high-level committee to monitor implementation of crop loan waiver, says Harish Rao

CM announced unconditional crop loan waiver twice unlike other States, he said 




ri

Tales of food and how it brings people together 

Celebrating the spirit of togetherness, artist students have curated an exhibition titled, ‘Savouring Connections: How Food Brings Us Together’ at Karl and Meherbai Khandalavala Gallery, CSMVS museum




ri

Vennela Kishore to headline ‘Chaari 111’, a spy action comedy

Telugu comedy actor Vennela Kishore to play the hero in director T.G. Keerthi Kumar’s spy action comedy ‘Chaari 111’




ri

69th National Film Awards: ‘RRR’, ‘Pushpa - The Rise’ lead as Telugu films grab 10 awards; Allu Arjun is best actor

S.S. Rajamouli’s ‘RRR’ bagged six awards, followed by ‘Pushpa - The Rise’, ‘Uppena’ and ‘Konda Polam’ at the 69th National Film Awards. Allu Arjun won the award for best actor, while ‘RRR’ was declared the best popular film for providing wholesome entertainment




ri

‘Gandeevadhari Arjuna’ movie review: Slick and well intended, albeit tepidly

Along with noble intentions, director Praveen Sattaru and actor Varun Tej’s slick Telugu thriller drama ‘Gandeevadhari Arjuna’ needed a smarter script




ri

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




ri

Rare handscrolls of artist Benode Behari Mukherjee on show in Kochi

The exhibition, organised by the Kolkata Centre for Creativity along with the Kerala Lalithakala Akademi and Gallery Rasa, pays tribute to artist Benode Behari Mukherjee, one of the pioneers of Indian modern art




ri

Anushka Shetty on ‘Miss Shetty Mr Polishetty’: The simplest of stories can be tough to narrate

Actor Anushka Shetty talks about her new Telugu film ‘Miss Shetty Mr Polishetty’, signing her first Malayalam film ‘Kathanar’ and why she felt the need to pause and reboot




ri

Tharun Bhascker’s crime comedy ‘Keedaa Cola’, presented by Rana Daggubati, announces its release date

Actor-director Tharun Bhascker Dhaassyam’s Telugu crime comedy ‘Keeda Cola’, presented by Rana Daggubati, will arrive in theatres in November




ri

Sikkil Gurucharan’s heartfelt tribute to his guru and grandmother Sikkil Neela

A well-known Carnatic vocalist, Gurucharan shares memories of growing up with his legendary flautist-grandmother, who honed his musical skills




ri

Director Vassishta: The audience can expect to see Chiranjeevi in an entertaining fantasy film like ‘Jagadeka Veerudu Athiloka Sundari’

Director Vassishta opens up on his next film starring Chiranjeevi and says it will be a fantasy entertainer, steeped in visual effects, in which the superstar will play a mature character befitting his stature and age




ri

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

ri

A spiritual confluence at Varanasi

The Sankara Math at Hanuman Ghat has been a beehive of activities with the presence of the Kanchi Sankaracharya




ri

‘Our goal was to bring intelligent conversations to Hyderabad’

Since 2005 Manthan as a platform succeeded in hosting 450 speakers in their monthly events, and about 65 speakers at the annual Samvaad




ri

Srikanth Nagothi: In ‘Month of Madhu’, I have tried to not judge the characters portrayed by Swathi and Naveen Chandra

Director Srikanth Nagothi holds forth on his Telugu film ‘Month of Madhu’ that features Swathi and Naveen Chandra as a middle-class couple




ri

Daily quiz | On James Bond film series

On October 5, 1962, Dr. No, the first film of the James Bond series was released in the United Kingdom. A quiz on the film series based on the books written by Ian Fleming




ri

New menu of Chettinad Canteen in Coimbatore features kavuni arisi appam, bun parotta and more

From feather-light ‘kavanarisi appam’ in coconut milk and ‘kuzhi paniyaram’ served with ‘pepper kaadai’ to the classic ‘adi kumayam’ in ice cream, what makes this new menu tick at the Chettinad Canteen




ri

Alcohol and Cancer Risk

A fact sheet that summarizes the evidence linking alcohol consumption to the risk of various cancers. Includes information about factors that affect the risk of alcohol-associated cancers, such as a person’s genes and tobacco use.




ri

Primary Bone Cancer

A fact sheet about the diagnosis and treatment of cancers that develop in the bones.




ri

Cell Phones and Cancer Risk

A fact sheet that outlines the available evidence regarding use of cellular/mobile telephones and cancer risk.




ri

Genetic Testing for Inherited Cancer Susceptibility Syndromes

A fact sheet about genetic testing for inherited cancer risk, including who should consider testing, how to understand test results, and who has access to a person’s test results. Also contains information about at-home, or direct-to-consumer, genetic tests.




ri

Gauri Khan shares designs secrets from her latest project, the Falguni Shane Peacock store in Kolkata 

This is the third store that Gauri Khan has designed for FSP, after Mumbai and Hyderabad




ri

Domestic air passenger traffic rise 9% in November

IndiGo remained the country's largest domestic carrier but its market share declined to 61.8% in November from 62.6% in October.




ri

American Airlines postpones launch of Seattle-Bengaluru flight

The airline says it is because this route requires flying through airspace currently involved in a military conflict




ri

Secret portals to local culture | Why LuxUnlock’s strategy with private villas is worth noting

A Chennai-based villa rental company’s strategy might well hold the key to growing regional tourism in 2024




ri

Araku Pinery, a new community-based eco-tourism project near Visakhapatnam

Enjoy misty winter mornings with a warm cup of coffee at Araku Pinery, a new eco-tourism project by the AP Forest Department in Anjoda, located at a distance of about 130 kilometres from Visakhapatnam




ri

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




ri

Ministry of Tourism promotes lesser-known tourist attractions

They include wetlands such as Sultanpur in Haryana, places of mythological significance such as Kurukshetra in Haryana, and cultural heritage sites such as Vijayawada in Andhra Pradesh




ri

Traversing through time: Exploring Coimbatore through a heritage walk

Discovering nuggets of Coimbatore’s history through the 16th year of the heritage walk by historian Rajesh Govindarajulu




ri

Experience a slice of tribal life at Giri Grama Darshini, a tourism project near Visakhapatnam

Get a peek of the adivasi culture at Giri Grama Darshini, a tourism project by ITDA and Pedalabudu Eco Tourism Society




ri

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




ri

Day trips to Kashmir’s border towns, Gurez and Keran

As the army welcomes trekkers and tourists to Gurez and Keran, one can see local life play out and catch glimpses of the other side