sin

Stock to buy today: PNB Housing Finance (₹999.2)

The price action over the past couple of weeks indicates good buying interest




sin

Two options for using custom properties

Recently I interviewed Stefan Judis for my upcoming book. We discussed CSS custom properties, and something interesting happened.

We had a period of a few minutes where we were talking past one another, because, as it turns out, we have completely opposite ideas about the use of CSS custom properties. I had never considered his approach, and I found it interesting enough to write this quick post.

Option 1

Take several site components, each with their own link and hover/focus colours. We want to use custom properties for those colours. Exactly how do we do that?

Before my discussion with Stefan that wasn’t even a question for me. I would do this:

.component1 {
	--linkcolor: red;
	--hovercolor: blue;
}

.component2 {
	--linkcolor: purple;
	--hovercolor: cyan;
}

a {
	color: var(--linkcolor);
}

a:hover,a:focus {
	color: var(--hovercolor)
}

I set the normal and hover/focus colour as a custom property, and leave the definition of those properties to the component the link appears in. The first and second component each define different colours, which are deployed in the correct syntax. Everything works and all’s well with the world.

As far as I can see now this is the default way of using CSS custom properties. I wasn’t even aware that another possibility existed.

Option 2

Stefan surprised me by doing almost the complete opposite. He uses only a single variable and changes its value where necessary:

.component1 {
	--componentcolor: red;
}

.component1 :is(a:hover,a:focus) {
	--componentcolor: blue;
}
	
.component2 {
	--componentcolor: purple;
}

.component2 :is(a:hover,a:focus) {
	--componentcolor: cyan;
}
	
a {
	color: var(--componentcolor)		
}

At first I was confused. Why would you do this? What’s the added value of the custom property? Couldn’t you just have entered the colour values in the component styles without using custom properties at all?

Well, yes, you could. But that’s not Stefan’s point.

The point

In practice, component definitions have way more styles than just colours. There’s a bunch of box-model properties, maybe a display, and possibly text styling instructions. In any case, a lot of lines of CSS.

If you use custom properties only for those CSS properties that will change you give future CSS developers a much better and quicker insight in how your component works. If the definition uses a custom property that means the property may change in some circumstances. If it uses a fixed definition you know it’s a constant.

Suppose you encounter this component definition in a codebase you just inherited:

.component {
	--color: red;
	--background: blue
	--layout: flex;
	--padding: 1em;
	--borderWidth: 0.3em;
	display: var(--layout);
	color: var(--color);
	background: var(--background);
	padding: var(--padding);
	border: var(--borderWidth) solid black;
	margin: 10px;
	border-radius: 2em;
	grid-template-columns: repeat(3,1fr);
	flex-wrap: wrap;
}

Now you essentially found a definition file. Not only do you see the component’s default styles, you also see what might change and what will not. For instance, because the margin and border-radius are hard-coded you know they are never changed. In the case of the border, only the width changes, not the style or the colour. Most other properties can change.

The use of display: var(--layout) is particularly revealing. Apparently something somewhere changes the component’s layout from grid to flexbox. Also, if it’s a grid it has three equal columns, while if it’s a flexbox it allows wrapping. This suggests that the flexbox layout is used on narrower screens, switching to a grid layout on wider screens.

Where does the flexbox change to a grid? As a newbie to this codebase you don’t know, but you can simply search for --layout: grid and you’ll find it, probably neatly tucked away in a media query somewhere. Maybe there is a basic layout as well, which uses neither flexbox nor grid? Search for --layout: block and you’ll know.

Thus, this way of using custom properties is excellently suited for making readable code bases that you can turn over to other CSS developers. They immediately know what changes and what doesn’t.

Teaching aid?

There’s another potential benefit as well: this way of using custom properties, which are essentially variables, aligns much more with JavaScript’s use of variables. You set an important variable at the start of your code, and change it later on if necessary. This is what you do in JavaScript all the time.

Thus this option may be better suited to teaching CSS to JavaScripters, which remains one of my preoccupations due to the upcoming book.

Picking an option

Which option should you pick? That’s partly a matter of personal preference. Since the second option is still fairly new to me, and I rarely work on large projects, I am still feeling my way around it. Right at this moment I prefer the first way because I’m used to it. But that might change, given some extra time.

Still, I think Stefan is on to something. I think that his option is very useful in large codebases that can be inherited by other developers. I think it deserves careful consideration.



  • CSS for JavaScripters

sin

New business wanted

Last week Krijn and I decided to cancel performance.now() 2021. Although it was the right decision it leaves me in financially fairly dire straits. So I’m looking for new jobs and/or donations.

Even though the Corona trends in NL look good, and we could probably have brought 350 people together in November, we cannot be certain: there might be a new flare-up. More serious is the fact that it’s very hard to figure out how to apply the Corona checks Dutch government requires, especially for non-EU citizens. We couldn’t figure out how UK and US people should be tested, and for us that was the straw that broke the camel’s back. Cancelling the conference relieved us of a lot of stress.

Still, it also relieved me of a lot of money. This is the fourth conference in a row we cannot run, and I have burned through all my reserves. That’s why I thought I’d ask for help.

So ...

Has QuirksMode.org ever saved you a lot of time on a project? Did it advance your career? If so, now would be a great time to make a donation to show your appreciation.

I am trying my hand at CSS coaching. Though I had only few clients so far I found that I like it and would like to do it more. As an added bonus, because I’m still writing my CSS for JavaScripters book I currently have most of the CSS layout modules in my head and can explain them straight away — even stacking contexts.

Or if there’s any job you know of that requires a technical documentation writer with a solid knowledge of web technologies and the browser market, drop me a line. I’m interested.

Anyway, thanks for listening.




sin

IISc study reveals that picolinic acid can block viruses causing SARS-CoV-2 and influenza A

The study describes the compound’s remarkable ability to disrupt the entry of enveloped viruses into the host’s cell and prevent infection




sin

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 




sin

‘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 




sin

Naga cuisine, an artsy deli, a chocolate nook: Mumbai’s three new cafés

A three-table Naga restaurant, an artsy deli in a 1940s Art Deco mansion and a new chocolate nook: here are three new cafés to check out in Mumbai




sin

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




sin

Chasing a sunrise | When you are on vacation without a moment to relax

In an age of social media, bombarded by the glossy feed of travel bloggers, the fear of missing out is far more acute




sin

Flight cancellations affected 1.5 lakh people since December 2023: Data

After the COVID-19 lockdowns and jet fuel hikes, aviation firms are now grappling with crew troubles




sin

Disney Adventure cruise ship to set sail from Singapore in 2025

Disney Cruise Line’s new vessel Disney Adventure will house seven immersive experience zones inspired by Disney, Pixar, and Marvel worlds




sin

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




sin

12 arrested for running illegal lottery businesses in Puducherry




sin

Low-pressure hydrogen sensing mechanism based on the field emission of defect-controlled ZnO nanorods

J. Mater. Chem. C, 2024, 12,17419-17428
DOI: 10.1039/D4TC01951B, Paper
Mingliang Dong, Weijin Qian, Youqing Tu, Guitao Chen, Weijun Huang, Haijun Luo, Changkun Dong
The work function of ZnO is reduced with H adsorbed on oxygen defects, leading to the hydrogen sensing effect.
The content of this RSS Feed (c) The Royal Society of Chemistry




sin

Cuprous-based layered single-crystalline scintillators for X-ray detection and imaging

J. Mater. Chem. C, 2024, 12,17587-17594
DOI: 10.1039/D4TC03080J, Paper
Yuke Zhao, Danping Chen, Haitao Tang, Hailin Liu, Yong Liu, Yangyang Dang, Qianqian Lin
A new metal halide single crystal (C6H10N2)2Cu2I3(PO2)3 was demonstrated. The optical and X-ray properties of (C6H10N2)2Cu2I3(PO2)3 were fully characterized and evaluated, which demonstrated great potential for X-ray detection and imaging.
The content of this RSS Feed (c) The Royal Society of Chemistry




sin

Online and offline learning using fading memory functions in HfSiOx-based ferroelectric tunnel junctions

J. Mater. Chem. C, 2024, 12,17362-17376
DOI: 10.1039/D4TC03397C, Communication
Jungwoo Lee, Chaewon Youn, Jungang Heo, Sungjun Kim
We demonstrate online and offline learning as well as associative learning such as in Pavlov's dog experiments using the non-volatile and volatile properties of HfSiOx-based FTJs.
The content of this RSS Feed (c) The Royal Society of Chemistry




sin

Highly sensitive OFET based room temperature operated gas sensors using a thieno[3,2-b]thiophene extended phthalocyanine semiconductor

J. Mater. Chem. C, 2024, Advance Article
DOI: 10.1039/D4TC03208J, Paper
Recep Isci, Ozgur Yavuz, Sheida Faraji, Dilara Gunturkun, Mehmet Eroglu, Leszek A. Majewski, Ismail Yilmaz, Turan Ozturk
A novel thienothiophene (TT) and phthalocyanine (Pc) based conjugated material was designed, synthesized, fabricated for an organic field effect transistor (OFET) and utilized as an OFET based gas sensor for hazardous gases such as NO2 and SO2.
To cite this article before page numbers are assigned, use the DOI form of citation above.
The content of this RSS Feed (c) The Royal Society of Chemistry




sin

Enhanced electrical properties of lead-free sodium potassium niobate piezoelectric ceramics prepared via cold sintering assisted sintering

J. Mater. Chem. C, 2024, Advance Article
DOI: 10.1039/D4TC04031G, Paper
Yao Huang, Xinyue Song, Renbing Sun, Hai Jiang, Peng Du, Laihui Luo
The CSAS method can increase the density of the ceramics and reduce the volatilization of the A-site elements, thus changing the phase structure of the ceramics and making them high piezoelectric properties.
To cite this article before page numbers are assigned, use the DOI form of citation above.
The content of this RSS Feed (c) The Royal Society of Chemistry




sin

Temperature and locomotion dual self-sensing soft robot based on liquid crystal polymer foams

J. Mater. Chem. C, 2024, Accepted Manuscript
DOI: 10.1039/D4TC03668A, Paper
Shuyun Zhuo, Jie Jiang, Yaru Ma, Yiming Chen, Yue Zhao
Stimuli-triggered actuation and capability of sensing are two important prerequisites for self-sensing soft robots. Currently, liquid crystal polymer (LCP) based soft robots face difficulties in balancing the actuation and sensing...
The content of this RSS Feed (c) The Royal Society of Chemistry




sin

Light-induced magnetic switching in a coumarin-based Tb Single Molecule Magnet

J. Mater. Chem. C, 2024, Accepted Manuscript
DOI: 10.1039/D4TC03152K, Paper
Open Access
Elena Bartolomé, Ana Arauzo, Javier Luzón, Laura Gasque
We present the intriguing magneto-optical properties of the lanthanide complex [Tb(coum)3(batho)]·0.7EtOH], named Tb-batho, based on coum = 3-acetyl-4-hydroxylato-coumarin and batho = bathophenanthroline ligands. Tb-batho displays visible-range luminescence with a notable...
The content of this RSS Feed (c) The Royal Society of Chemistry




sin

Tuning the performance of PSCs using rare-earth elements

J. Mater. Chem. C, 2024, Advance Article
DOI: 10.1039/D4TC03798G, Review Article
Sajid Sajid, Salem Alzahmi, Nouar Tabet, Mohammad Y. Al-Haik, Mahmoud Abdel-Hafiez, Yousef Haik, Ihab M. Obaidat
Perovskite solar cells (PSCs) are emerging and promising alternatives to the market-leading solar cells due to their high performance, low fabrication cost, and versatile material modification.
To cite this article before page numbers are assigned, use the DOI form of citation above.
The content of this RSS Feed (c) The Royal Society of Chemistry




sin

A metal–organic framework enhanced single network organohydrogel with superior low-temperature adaptability and UV-blocking capability towards human-motion sensing

J. Mater. Chem. C, 2024, Advance Article
DOI: 10.1039/D4TC03148B, Paper
Ying Li, Zhongquan Yu, Jialuo Zhang, Enke Feng, Xiaoqin Li, Linan Cao, Zhiming Yang, Zhiqiang Wu
A UiO-66-NH2 nanoparticle reinforced organohydrogel with anti-freezing and UV-blocking properties was synthesized for sensing complex human movements and transmitting different messages even at subzero temperature.
To cite this article before page numbers are assigned, use the DOI form of citation above.
The content of this RSS Feed (c) The Royal Society of Chemistry




sin

Tb(III)-Functionalized MOF Hybridized Bis-crosslinked Networked Hydrogel Luminescent Films for Arginine and Dopamine Hydrochloride Sensing and Anticounterfeiting

J. Mater. Chem. C, 2024, Accepted Manuscript
DOI: 10.1039/D4TC03444A, Paper
Jiaxuan Pan, JZ Lu, Yichen Shang, Ying Li, Bing Yan
Dopamine and arginine are both important substances in the body and are closely related to human health. Timely detection of their concentration abnormalities is of great significance for dsaevention. In...
The content of this RSS Feed (c) The Royal Society of Chemistry




sin

Oxide Lu2TeO6 single crystal for X-ray detection with ultralow detection limit.

J. Mater. Chem. C, 2024, Accepted Manuscript
DOI: 10.1039/D4TC04341C, Paper
Tingting Cao, Feifei Guo, Fuai Hu, Xutang Tao, Zeliang Gao
Semiconductor-based X-ray detectors become critical in medical diagnosis, industrial inspections, and scientific research. The recently reported metal oxide single crystal materials have demonstrated low detection limits and outstanding stability. Herein,...
The content of this RSS Feed (c) The Royal Society of Chemistry




sin

Large magnetic anisotropy and rotating cryomagnetocaloric effect in single-crystalline paramagnetic lanthanide calcium oxyborates LnCa4O(BO3)3 with Ln = Pr, Nd, Gd, Tm, Er

J. Mater. Chem. C, 2024, Accepted Manuscript
DOI: 10.1039/D4TC03249G, Paper
Fatiha Azrour, Romain Viennois, Jérôme Long, Corine Reibel, Jérome Debray, Fapeng Yu, Shujun Zhang, Mickaël Beaudhuin, Jerome Rouquette
The lanthanide calcium oxyborates LnCa4O(BO3)3 compounds form a family of multifunctional materials with promising nonlinear and linear optical properties and piezoelectrical properties because of their polar crystal structure. In the...
The content of this RSS Feed (c) The Royal Society of Chemistry




sin

Robust Dihydroxyacetone Production via Photoelectrochemical Glycerol Oxidation using Oxygen Vacant BiVO4 Photoanode

J. Mater. Chem. C, 2024, Accepted Manuscript
DOI: 10.1039/D4TC04085F, Paper
Yeji Lee, Yeseul Jo, Youn Jeong Jang
Photoelectrochemical conversion of glycerol into high-value dihydroxyacetone offers a sustainable approach via BiVO4 semiconductor materials, which manifest highly photoactive properties. However, dihydroxyacetone production poses a limitation due to poor charge...
The content of this RSS Feed (c) The Royal Society of Chemistry




sin

Chasing gold for a lost world—the threat of climate change



  • Solutions & Co

sin

Enterprising solutions



  • Solutions & Co

sin

20 Business Newspapers Cover 50 Solutions for climate




sin

Easter Island seeks to irrigate crops using solar energy

Due to the summer drought, Islanders have to get 52% of their fruits and vegetables from the mainland because local production cannot meet domestic demand.



  • Solutions & Co

sin

Business not as usual

The B Team is an international group of business leaders leveraging their influence for the common good. It is also a partner of Sparknews, who recently caught up with co-founder Sir Richard Branson in New York City



  • Solutions & Co



sin

WATCH: Javed Ali Sing Srivalli!

For two hours, Javed Ali sang. And his fans went crazy.




sin

Prachita Sings For Lata Mangeshkar

On Lata Mangeshkar's birthday, Prachita Baban Patil sings for the legend.




sin

A Teacher Sings His Favourite Lata Song

'It is very natural to connect to Lataji's songs whenever I am singing,' says Atul Bane.




sin

SEE: Yo Yo Honey Singh Sings Gatividhi

'I can't believe that I was out of the scene for seven long years.'






sin

Losing ground in the war on superbugs

Rising drug resistance has left Indian doctors struggling to treat complex infections.



  • Policy & Issues

sin

First case of pregnant woman diagnosed with Zika in Singapore




sin

New single-dose treatment shows promise in anti-malaria battle



  • Policy & Issues

sin

Harnessing luciferase chemistry in regulated cell death modalities and autophagy: overview and perspectives

Chem. Soc. Rev., 2024, Advance Article
DOI: 10.1039/D3CS00743J, Review Article
Saman Hosseinkhani, Mojdeh Amandadi, Parisa Ghanavatian, Fateme Zarein, Farangis Ataei, Maryam Nikkhah, Peter Vandenabeele
This review provides a comprehensive overview of the use of bioluminescence assays in advancing our understanding and studying cell death modalities and autophagy.
To cite this article before page numbers are assigned, use the DOI form of citation above.
The content of this RSS Feed (c) The Royal Society of Chemistry




sin

Progress and challenges in structural, in situ and operando characterization of single-atom catalysts by X-ray based synchrotron radiation techniques

Chem. Soc. Rev., 2024, Advance Article
DOI: 10.1039/D3CS00967J, Review Article
Yuhang Liu, Xiaozhi Su, Jie Ding, Jing Zhou, Zhen Liu, Xiangjun Wei, Hong Bin Yang, Bin Liu
Single-atom catalysts (SACs) represent the ultimate size limit of nanoscale catalysts, combining the advantages of homogeneous and heterogeneous catalysts.
To cite this article before page numbers are assigned, use the DOI form of citation above.
The content of this RSS Feed (c) The Royal Society of Chemistry




sin

Ultrasound mechanisms and their effect on solid synthesis and processing: a review

Chem. Soc. Rev., 2024, Advance Article
DOI: 10.1039/D4CS00148F, Review Article
Open Access
  This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.
Cedric Devos, Ariana Bampouli, Elena Brozzi, Georgios D. Stefanidis, Michiel Dusselier, Tom Van Gerven, Simon Kuhn
Ultrasound intensifies a wide range of processes involving solids, enhancing control over their formation and post-treatment. This review summarizes key ultrasonic mechanisms and effects in solids' synthesis and processing.
To cite this article before page numbers are assigned, use the DOI form of citation above.
The content of this RSS Feed (c) The Royal Society of Chemistry




sin

Harnessing DNA computing and nanopore decoding for practical applications: from informatics to microRNA-targeting diagnostics

Chem. Soc. Rev., 2024, Advance Article
DOI: 10.1039/D3CS00396E, Tutorial Review
Open Access
  This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.
Sotaro Takiguchi, Nanami Takeuchi, Vasily Shenshin, Guillaume Gines, Anthony J. Genot, Jeff Nivala, Yannick Rondelez, Ryuji Kawano
This tutorial review provides fundamentals on DNA computing and nanopore-based decoding, highlighting recent advances towards microRNA-targeting diagnostic applications.
To cite this article before page numbers are assigned, use the DOI form of citation above.
The content of this RSS Feed (c) The Royal Society of Chemistry




sin

Recent synthetic strategies for the functionalization of fused bicyclic heteroaromatics using organo-Li, -Mg and -Zn reagents

Chem. Soc. Rev., 2024, 53,11045-11099
DOI: 10.1039/D4CS00369A, Review Article
Open Access
  This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.
Vasudevan Dhayalan, Vishal S. Dodke, Marappan Pradeep Kumar, Hatice Seher Korkmaz, Anja Hoffmann-Röder, Pitchamuthu Amaladass, Rambabu Dandela, Ragupathy Dhanusuraman, Paul Knochel
This review presents various new strategies for the functionalization of 5 and 6-membered fused heteroaromatics. These synthetic strategies enable rapid access to complex heterocyclic compounds.
The content of this RSS Feed (c) The Royal Society of Chemistry




sin

RERA: A blessing in disguise for realty sector

It is expected to increase pan-India sales besides counteracting lengthy and cost-intensive dispute resolution mechanisms. By Shrinivas Rao




sin

Affordable housing breaks ground

In spite of a massive dip in 2020 due to the pandemic and lockdown, 2021 saw the launch of nearly 2.37 lakh units in this segment, which significantly powers the country’s economic growth




sin

Women make film : una nueva road movie a lo largo de la historia del cine (2018) / written and directed by Mark Cousins [DVD].

[Spain] : Avalon, [2020]