y Copper futures likely to rally, go long By www.thehindubusinessline.com Published On :: Mon, 04 Nov 2024 12:55:39 +0530 The November contract can touch ₹875 Full Article Commodity Calls
y F&O Query: Should you hold call options on Reliance Industries and ICICI Bank? By www.thehindubusinessline.com Published On :: Mon, 04 Nov 2024 13:30:44 +0530 Full Article Derivatives
y Today’s Stock Recommendation: November 5, 2024 By www.thehindubusinessline.com Published On :: Tue, 05 Nov 2024 06:30:00 +0530 The stock idea that we have for you today is Angel One Full Article Video
y Stock to buy today: Angel One (₹2,886.35): BUY By www.thehindubusinessline.com Published On :: Tue, 05 Nov 2024 06:30:00 +0530 Angel One share price can rise to ₹3,400 after some more fall from here Full Article Technical Analysis
y Nifty Prediction today – Nov 5, 2024: Downtrend might resume, go short By www.thehindubusinessline.com Published On :: Tue, 05 Nov 2024 10:17:17 +0530 Nifty futures can decline to 23,500 in the near term Full Article Technical Analysis
y Bank Nifty Prediction today – Nov 5, 2024: Might fall off a barrier, initiate short By www.thehindubusinessline.com Published On :: Tue, 05 Nov 2024 10:29:43 +0530 Bank Nifty November futures areis likely to see a decline Full Article Technical Analysis
y Day trading guide for November 5, 2024: Intraday supports, resistances for Nifty50 stocks By www.thehindubusinessline.com Published On :: Tue, 05 Nov 2024 12:01:00 +0530 Here are the intraday supports and resistances for widely traded stocks such as Reliance Industries, ITC, ONGC, Infosys, HDFC Bank, TCS, and SBI Full Article Day trading guide
y Aluminium futures: Potential rally ahead By www.thehindubusinessline.com Published On :: Tue, 05 Nov 2024 12:06:29 +0530 The November futures can rise to ₹255 Full Article Commodity Calls
y F&O Query: Should you hold call options on Infosys and Voltas? By www.thehindubusinessline.com Published On :: Tue, 05 Nov 2024 14:41:25 +0530 Full Article Derivatives
y Weekly Rupee View: Rupee set to witness higher volatility By www.thehindubusinessline.com Published On :: Tue, 05 Nov 2024 17:00:15 +0530 US election and the Fed policy announcement are the key events Full Article Technical Analysis
y Day trading guide for November 6, 2024: Intraday supports, resistances for Nifty50 stocks By www.thehindubusinessline.com Published On :: Wed, 06 Nov 2024 06:20:00 +0530 Here are the intraday supports and resistances for widely traded stocks such as Reliance Industries, ITC, ONGC, Infosys, HDFC Bank, TCS, and SBI Full Article Day trading guide
y Stock to buy today: Tata Steel (₹152.30) By www.thehindubusinessline.com Published On :: Wed, 06 Nov 2024 06:30:00 +0530 For the short term, traders can buy shares of Tata Steel at ₹152 and on a dip to ₹148 Full Article Technical Analysis
y Nifty Prediction today – Nov 6, 2024: Momentum favours bulls, go long By www.thehindubusinessline.com Published On :: Wed, 06 Nov 2024 11:14:17 +0530 Nifty futures can rise to 24,750 Full Article Technical Analysis
y Bank Nifty Prediction today – Nov 6, 2024: Intraday trend uncertain, stay out By www.thehindubusinessline.com Published On :: Wed, 06 Nov 2024 11:26:19 +0530 Bank Nifty futures is trading between key levels at 52,000 and 52,800 Full Article Technical Analysis
y Zinc futures remain above key support By www.thehindubusinessline.com Published On :: Wed, 06 Nov 2024 15:58:57 +0530 Traders can consider longs on dips Full Article Commodity Calls
y L&T-E2E deal: AI frenzy or real boom? By www.thehindubusinessline.com Published On :: Wed, 06 Nov 2024 20:53:59 +0530 When one looks at the valuation at which L&T is making this investment, the numbers get a bit head-scratching Full Article Stock Fundamentals
y Day trading guide for November 7, 2024: Intraday supports, resistances for Nifty50 stocks By www.thehindubusinessline.com Published On :: Thu, 07 Nov 2024 06:19:00 +0530 Here are the intraday supports and resistances for widely traded stocks such as Reliance Industries, ITC, ONGC, Infosys, HDFC Bank, TCS, and SBI Full Article Day trading guide
y Stock to buy today: PNB Housing Finance (₹999.2) By www.thehindubusinessline.com Published On :: Thu, 07 Nov 2024 06:30:00 +0530 The price action over the past couple of weeks indicates good buying interest Full Article Technical Analysis
y Bank Nifty Prediction today – Nov 7, 2024: Hovering around a support, short if this base is broken By www.thehindubusinessline.com Published On :: Thu, 07 Nov 2024 10:34:16 +0530 Bank Nifty futures can fall to 51,300 if it slips below 52,000 Full Article Technical Analysis
y ACME Solar Holdings: Should you subscribe to the IPO? By www.thehindubusinessline.com Published On :: Thu, 07 Nov 2024 10:34:50 +0530 Amongst the top 10 IPPs in the renewable segment, the company is in the process of diversifying from solar to wind, hybrid and FDRE projects Full Article Portfolio
y Nifty Prediction today – Nov 7, 2024: Bears gain momentum; go short if the support is breached By www.thehindubusinessline.com Published On :: Thu, 07 Nov 2024 10:38:30 +0530 Nifty futures has a support at 24,250; a breach of this can lead to a fall to 24,000 Full Article Technical Analysis
y Post mixed Q2, India Inc may face tailwinds in second half of FY25 By www.thehindubusinessline.com Published On :: Thu, 07 Nov 2024 12:34:17 +0530 It needs to be seen if fortunes for the consumer segments will reverse Full Article Stock Fundamentals
y Natural gas futures: Uncertainty prevails By www.thehindubusinessline.com Published On :: Thu, 07 Nov 2024 13:00:03 +0530 Traders need to wait for strong cues about next leg of trend Full Article Commodity Calls
y Day trading guide for November 8, 2024: Intraday supports, resistances for Nifty50 stocks By www.thehindubusinessline.com Published On :: Fri, 08 Nov 2024 06:26:00 +0530 Here are the intraday supports and resistances for widely traded stocks such as Reliance Industries, ITC, ONGC, Infosys, HDFC Bank, TCS, and SBI Full Article Day trading guide
y Stock to buy today: Deepak Nitrite (₹2,815.65) By www.thehindubusinessline.com Published On :: Fri, 08 Nov 2024 06:30:00 +0530 Although there was a price drop on Thursday, the scrip retains its bullishness Full Article Technical Analysis
y Nifty prediction today – Nov 8, 2024: Intraday outlook is unclear. Stay out of the market By www.thehindubusinessline.com Published On :: Fri, 08 Nov 2024 10:33:16 +0530 Nifty 50 November futures contract can oscillate in a range of 24,150-24,400 Full Article Technical Analysis
y Bank Nifty prediction today – Nov 8, 2024: Trading within a range By www.thehindubusinessline.com Published On :: Fri, 08 Nov 2024 10:38:01 +0530 Bank Nifty futures is currently stuck between 52,000 and 52,500 Full Article Technical Analysis
y Ayushman Bharat senior citizen health insurance: Benefits and enrolment details By www.thehindubusinessline.com Published On :: Fri, 08 Nov 2024 17:27:15 +0530 The Ayushman Bharat scheme offers ₹5 lakh health coverage for seniors 70+, free and with easy Aadhaar-based enrollment Full Article Personal Finance
y Why you should home in on this premium realty player By www.thehindubusinessline.com Published On :: Fri, 08 Nov 2024 18:50:57 +0530 Robust traction in the upmarket residential segment, healthy occupancies in its commercial rental business and healthy financials are positives for Oberoi Realty Full Article Stock Fundamentals
y Mastering Derivatives: Does futures price decay? By www.thehindubusinessline.com Published On :: Fri, 08 Nov 2024 21:30:17 +0530 Here’s a low down on the key components in future contracts’ pricing Full Article Derivatives
y Insurance Query: Stay updated on changes in health insurance norms By www.thehindubusinessline.com Published On :: Fri, 08 Nov 2024 21:30:42 +0530 IRDAI’s changes to health insurance landscape provide enhanced protection, security and a more user-friendly experience Full Article Personal Finance
y Currency Outlook: Trump’s victory fuels dollar rally By www.thehindubusinessline.com Published On :: Sat, 09 Nov 2024 18:40:02 +0530 Rupee makes the much-awaited bearish breakout Full Article Technical Analysis
y Bullion Cues: Rally likely post dip By www.thehindubusinessline.com Published On :: Sat, 09 Nov 2024 18:40:49 +0530 Traders can buy at lower levels Full Article Derivatives
y Crude Check: No clarity in trend By www.thehindubusinessline.com Published On :: Sat, 09 Nov 2024 18:41:07 +0530 Traders can avoid new positions Full Article Derivatives
y F&O Strategy: Short Torrent Pharma By www.thehindubusinessline.com Published On :: Sat, 09 Nov 2024 18:41:37 +0530 Derivatives traders can either go short on futures contract or buy a put option, depending on the risk appetite Full Article Derivatives
y Tech Query: What is the outlook for TVS Holdings, Gujarat State Fertilizers & Chemicals (GSFC), Ideaforge Technology and Niyogin Fintech? By www.thehindubusinessline.com Published On :: Sat, 09 Nov 2024 18:43:09 +0530 We zoom in on the prospects of TVS Holdings, as also the prospects of three other stocks — Gujarat State Fertilizers & Chemicals (GSFC), Ideaforge Technology and Niyogin Fintech Full Article Technical Analysis
y Index Outlook: Vulnerable Sensex, Nifty 50 struggle By www.thehindubusinessline.com Published On :: Sat, 09 Nov 2024 18:43:26 +0530 Strong resistance coming up to halt the rally in the Dow Jones Full Article Technical Analysis
y Niva Bupa Health Insurance IPO: Should you subscribe? By www.thehindubusinessline.com Published On :: Sat, 09 Nov 2024 20:41:57 +0530 The company’s ability to reign in claims in the next three years is key monitorable Full Article Stock Fundamentals
y Trump, tariffs and tax cuts – Can they power the US stock markets ahead? By www.thehindubusinessline.com Published On :: Sat, 09 Nov 2024 20:42:45 +0530 As Trump 2.0 gets set to take control, the US markets are a play of opposing factors Full Article Big Story
y New vs Old: I-T regime choice can alter your net salary By www.thehindubusinessline.com Published On :: Mon, 11 Nov 2024 06:07:00 +0530 Each regime has its own tax rates, deductions and benefits that can significantly impact take-home pay. This overview help you determine which option might be the best fit for your financial situation. Full Article Personal Finance
y Stock to buy today: Mahindra & Mahindra (₹2,979.25): BUY By www.thehindubusinessline.com Published On :: Mon, 11 Nov 2024 06:30:00 +0530 Mahindra & Mahindra share price can rise to ₹3,200 Full Article Technical Analysis
y Nifty Prediction Today – November 11, 2024: Resistance ahead. Go short on a rise By www.thehindubusinessline.com Published On :: Mon, 11 Nov 2024 10:34:37 +0530 Nifty 50 November Futures contract can fall to 23,900 Full Article Technical Analysis
y Bank Nifty Prediction Today – November 11, 2024: Wait for dips to go long By www.thehindubusinessline.com Published On :: Mon, 11 Nov 2024 11:17:11 +0530 Bank Nifty November Futures can rise to 52,500 if the bounce sustains Full Article Technical Analysis
y Day trading guide for November 12, 2024: Intraday supports, resistances for Nifty50 stocks By www.thehindubusinessline.com Published On :: Tue, 12 Nov 2024 06:07:00 +0530 Here are the intraday supports and resistances for widely traded stocks such as Reliance Industries, ITC, ONGC, Infosys, HDFC Bank, TCS, and SBI Full Article Day trading guide
y Stock to buy today: HCL Technologies (₹1,867): BUY By www.thehindubusinessline.com Published On :: Tue, 12 Nov 2024 06:30:00 +0530 HCL Technologies share price can rise to ₹1,935 Full Article Technical Analysis
y Let’s talk about money By www.quirksmode.org Published On :: Tue, 29 Jun 2021 12:23:49 +0100 Let’s talk about money! Let’s talk about how hard it is to pay small amounts online to people whose work you like and who could really use a bit of income. Let’s talk about how Coil aims to change that. Taking a subscription to a website is moderately easy, but the person you want to pay must have enabled them. Besides, do you want to purchase a full subscription in order to read one or two articles per month? Sending a one-time donation is pretty easy as well, but, again, the site owner must have enabled them. And even then it just gives them ad-hoc amounts that they cannot depend on. Then there’s Patreon and Kickstarter and similar systems, but Patreon is essentially a subscription service while Kickstarter is essentially a one-time donation service, except that both keep part of the money you donate. And then there’s ads ... Do we want small content creators to remain dependent on ads and thus support the entire ad ecosystem? I, personally, would like to get rid of them. The problem today is that all non-ad-based systems require you to make conscious decisions to support someone — and even if you’re serious about supporting them you may forget to send in a monthly donation or to renew your subscription. It sort-of works, but the user experience can be improved rather dramatically. That’s where Coil and the Web Monetization Standard come in. Web Monetization The idea behind Coil is that you pay for what you consume easily and automatically. It’s not a subscription - you only pay for what you consume. It’s not a one-time donation, either - you always pay when you consume. Payments occur automatically when you visit a website that is also subscribed to Coil, and the amount you pay to a single site owner depends on the time you spend on the site. Coil does not retain any of your money, either — everything goes to the people you support. In this series of four articles we’ll take a closer look at the architecture of the current Coil implementation, how to work with it right now, the proposed standard, and what’s going to happen in the future. Overview So how does Coil work right now? Both the payer and the payee need a Coil account to send and receive money. The payee has to add a <meta> tag with a Coil payment pointer to all pages they want to monetize. The payer has to install the Coil extension in their browsers. You can see this extension as a polyfill. In the future web monetization will, I hope, be supported natively in all browsers. Once that’s done the process works pretty much automatically. The extension searches for the <meta> tag on any site the user visits. If it finds one it starts a payment stream from payer to payee that continues for as long as the payer stays on the site. The payee can use the JavaScript API to interact with the monetization stream. For instance, they can show extra content to paying users, or keep track of how much a user paid so far. Unfortunately these functionalities require JavaScript, and the hiding of content is fairly easy to work around. Thus it is not yet suited for serious business purposes, especially in web development circles. This is one example of how the current system is still a bit rough around the edges. You’ll find more examples in the subsequent articles. Until the time browsers support the standard natively and you can determine your visitors’ monetization status server-side these rough bits will continue to exist. For the moment we will have to work with the system we have. This article series will discuss all topics we touched on in more detail. Start now! For too long we have accepted free content as our birthright, without considering the needs of the people who create it. This becomes even more curious for articles and documentation that are absolutely vital to our work as web developers. Take a look at this list of currently-monetized web developer sites. Chances are you’ll find a few people whose work you used in the past. Don’t they deserve your direct support? Free content is not a right, it’s an entitlement. The sooner we internalize this, and start paying independent voices, the better for the web. The only alternative is that all articles and documentation that we depend on will written by employees of large companies. And employees, no matter how well-meaning, will reflect the priorities and point of view of their employer in the long run. So start now. In order to support them you should invest a bit of time once and US$5 per month permanently. I mean, that’s not too much to ask, is it? Continue I wrote this article and its sequels for Coil, and yes, I’m getting paid. Still, I believe in what they are doing, so I won’t just spread marketing drivel. Initially it was unclear to me exactly how Coil works. So I did some digging, and the remaining parts of this series give a detailed description of how Coil actually works in practice. For now the other three articles will only be available on dev.to. I just published part 2, which gives a high-level overview of how Coil works right now. Part 3 will describe the meta tag and the JavaScript API, and in part 4 we’ll take a look at the future, which includes a formal W3C standard. Those parts will be published next week and the week after that. Full Article Monetisation
y Custom properties and @property By www.quirksmode.org Published On :: Wed, 21 Jul 2021 14:18:40 +0100 You’re reading a failed article. I hoped to write about @property and how it is useful for extending CSS inheritance considerably in many different circumstances. Alas, I failed. @property turns out to be very useful for font sizes, but does not even approach the general applicability I hoped for. Grandparent-inheriting It all started when I commented on what I thought was an interesting but theoretical idea by Lea Verou: what if elements could inherit the font size of not their parent, but their grandparent? Something like this: div.grandparent { /* font-size could be anything */ } div.parent { font-size: 0.4em; } div.child { font-size: [inherit from grandparent in some sort of way]; font-size: [yes, you could do 2.5em to restore the grandparent's font size]; font-size: [but that's not inheriting, it's just reversing a calculation]; font-size: [and it will not work if the parent's font size is also unknown]; } Lea told me this wasn’t a vague idea, but something that can be done right now. I was quite surprised — and I assume many of my readers are as well — and asked for more information. So she wrote Inherit ancestor font-size, for fun and profit, where she explained how the new Houdini @property can be used to do this. This was seriously cool. Also, I picked up a few interesting bits about how CSS custom properties and Houdini @property work. I decided to explain these tricky bits in simple terms — mostly because I know that by writing an explanation I myself will understand them better — and to suggest other possibilities for using Lea’s idea. Alas, that last objective is where I failed. Lea’s idea can only be used for font sizes. That’s an important use case, but I had hoped for more. The reasons why it doesn’t work elsewhere are instructive, though. Tokens and values Let’s consider CSS custom properties. What if we store the grandparent’s font size in a custom property and use that in the child? div.grandparent { /* font-size could be anything */ --myFontSize: 1em; } div.parent { font-size: 0.4em; } div.child { font-size: var(--myFontSize); /* hey, that's the grandparent's font size, isn't it? */ } This does not work. The child will have the same font size as the parent, and ignore the grandparent. In order to understand why we need to understand how custom properties work. What does this line of CSS do? --myFontSize: 1em; It sets a custom property that we can use later. Well duh. Sure. But what value does this custom property have? ... errr ... 1em? Nope. The answer is: none. That’s why the code example doesn’t work. When they are defined, custom properties do not have a value or a type. All that you ordered the browsers to do is to store a token in the variable --myFontSize. This took me a while to wrap my head around, so let’s go a bit deeper. What is a token? Let’s briefly switch to JavaScript to explain. let myVar = 10; What’s the value of myVar in this line? I do not mean: what value is stored in the variable myVar, but: what value does the character sequence myVar have in that line of code? And what type? Well, none. Duh. It’s not a variable or value, it’s just a token that the JavaScript engine interprets as “allow me to access and change a specific variable” whenever you type it. CSS custom properties also hold such tokens. They do not have any intrinsic meaning. Instead, they acquire meaning when they are interpreted by the CSS engine in a certain context, just as the myVar token is in the JavaScript example. So the CSS custom property contains the token 1em without any value, without any type, without any meaning — as yet. You can use pretty any bunch of characters in a custom property definition. Browsers make no assumptions about their validity or usefulness because they don’t yet know what you want to do with the token. So this, too, is a perfectly fine CSS custom property: --myEgoTrip: ppk; Browsers shrug, create the custom property, and store the indicated token. The fact that ppk is invalid in all CSS contexts is irrelevant: we haven’t tried to use it yet. It’s when you actually use the custom property that values and types are assigned. So let’s use it: background-color: var(--myEgoTrip); Now the CSS parser takes the tokens we defined earlier and replaces the custom property with them: background-color: ppk; And only NOW the tokens are read and intrepreted. In this case that results in an error: ppk is not a valid value for background-color. So the CSS declaration as a whole is invalid and nothing happens — well, technically it gets the unset value, but the net result is the same. The custom property itself is still perfectly valid, though. The same happens in our original code example: div.grandparent { /* font-size could be anything */ --myFontSize: 1em; /* just a token; no value, no meaning */ } div.parent { font-size: 0.4em; } div.child { font-size: var(--myFontSize); /* becomes */ font-size: 1em; /* hey, this is valid CSS! */ /* Right, you obviously want the font size to be the same as the parent's */ /* Sure thing, here you go */ } In div.child he tokens are read and interpreted by the CSS parser. This results in a declaration font-size: 1em;. This is perfectly valid CSS, and the browsers duly note that the font size of this element should be 1em. font-size: 1em is relative. To what? Well, to the parent’s font size, of course. Duh. That’s how CSS font-size works. So now the font size of the child becomes the same as its parent’s, and browsers will proudly display the child element’s text in the same font size as the parent element’s while ignoring the grandparent. This is not what we wanted to achieve, though. We want the grandparent’s font size. Custom properties — by themselves — don’t do what we want. We have to find another solution. @property Lea’s article explains that other solution. We have to use the Houdini @property rule. @property --myFontSize { syntax: "<length>"; initial-value: 0; inherits: true; } div { border: 1px solid; padding: 1em; } div.grandparent { /* font-size could be anything */ --myFontSize: 1em; } div.parent { font-size: 0.4em; } div.child { font-size: var(--myFontSize); } Now it works. Wut? Yep — though only in Chrome so far. This is the grandparent This is the parent This is the child What black magic is this? Adding the @property rule changes the custom property --myFontSize from a bunch of tokens without meaning to an actual value. Moreover, this value is calculated in the context it is defined in — the grandfather — so that the 1em value now means 100% of the font size of the grandfather. When we use it in the child it still has this value, and therefore the child gets the same font size as the grandfather, which is exactly what we want to achieve. (The variable uses a value from the context it’s defined in, and not the context it’s executed in. If, like me, you have a grounding in basic JavaScript you may hear “closures!” in the back of your mind. While they are not the same, and you shouldn’t take this apparent equivalency too far, this notion still helped me understand. Maybe it’ll help you as well.) Unfortunately I do not quite understand what I’m doing here, though I can assure you the code snippet works in Chrome — and will likely work in the other browsers once they support @property. Misson completed — just don’t ask me how. Syntax You have to get the definition right. You need all three lines in the @property rule. See also the specification and the MDN page. @property --myFontSize { syntax: "<length>"; initial-value: 0; inherits: true; } The syntax property tells browsers what kind of property it is and makes parsing it easier. Here is the list of possible values for syntax, and in 99% of the cases one of these values is what you need. You could also create your own syntax, e.g. syntax: "ppk | <length>" Now the ppk keyword and any sort of length is allowed as a value. Note that percentages are not lengths — one of the many things I found out during the writing of this article. Still, they are so common that a special value for “length that may be a percentage or may be calculated using percentages” was created: syntax: "<length-percentage>" Finally, one special case you need to know about is this one: syntax: "*" MDN calls this a universal selector, but it isn’t, really. Instead, it means “I don’t know what syntax we’re going to use” and it tells browsers not to attempt to interpret the custom property. In our case that would be counterproductive: we definitely want the 1em to be interpreted. So our example doesn’t work with syntax: "*". initial-value and inherits An initial-value property is required for any syntax value that is not a *. Here that’s simple: just give it an initial value of 0 — or 16px, or any absolute value. The value doesn’t really matter since we’re going to overrule it anyway. Still, a relative value such as 1em is not allowed: browsers don’t know what the 1em would be relative to and reject it as an initial value. Finally, inherits: true specifies that the custom property value can be inherited. We definitely want the computed 1em value to be inherited by the child — that’s the entire point of this experiment. So we carefully set this flag to true. Other use cases So far this article merely rehashed parts of Lea’s. Since I’m not in the habit of rehashing other people’s articles my original plan was to add at least one other use case. Alas, I failed, though Lea was kind enough to explain why each of my ideas fails. Percentage of what? Could we grandfather-inherit percentual margins and paddings? They are relative to the width of the parent of the element you define them on, and I was wondering if it might be useful to send the grandparent’s margin on to the child just like the font size. Something like this: @property --myMargin { syntax: "<length-percentage>"; initial-value: 0; inherits: true; } div.grandparent { --myMargin: 25%; margin-left: var(--myMargin); } div.parent { font-size: 0.4em; } div.child { margin-left: var(--myMargin); /* should now be 25% of the width of the grandfather's parent */ /* but isn't */ } Alas, this does not work. Browsers cannot resolve the 25% in the context of the grandparent, as they did with the 1em, because they don’t know what to do. The most important trick for using percentages in CSS is to always ask yourself: “percentage of WHAT?” That’s exactly what browsers do when they encounter this @property definition. 25% of what? The parent’s font size? Or the parent’s width? (This is the correct answer, but browsers have no way of knowing that.) Or maybe the width of the element itself, for use in background-position? Since browsers cannot figure out what the percentage is relative to they do nothing: the custom property gets the initial value of 0 and the grandfather-inheritance fails. Colours Another idea I had was using this trick for the grandfather’s text colour. What if we store currentColor, which always has the value of the element’s text colour, and send it on to the grandchild? Something like this: @property --myColor { syntax: "<color>"; initial-value: black; inherits: true; } div.grandparent { /* color unknown */ --myColor: currentColor; } div.parent { color: red; } div.child { color: var(--myColor); /* should now have the same color as the grandfather */ /* but doesn't */ } Alas, this does not work either. When the @property blocks are evaluated, and 1em is calculated, currentColor specifically is not touched because it is used as an initial (default) value for some inherited SVG and CSS properties such as fill. Unfortunately I do not fully understand what’s going on, but Tab says this behaviour is necessary, so it is. Pity, but such is life. Especially when you’re working with new CSS functionalities. Conclusion So I tried to find more possbilities for using Lea’s trick, but failed. Relative units are fairly sparse, especially when you leave percentages out of the equation. em and related units such as rem are the only ones, as far as I can see. So we’re left with a very useful trick for font sizes. You should use it when you need it (bearing in mind that right now it’s only supported in Chromium-based browsers), but extending it to other declarations is not possible at the moment. Many thanks to Lea Verou and Tab Atkins for reviewing and correcting an earlier draft of this article. Full Article CSS for JavaScripters
y position: sticky, draft 1 By www.quirksmode.org Published On :: Wed, 08 Sep 2021 18:44:23 +0100 I’m writing the position: sticky part of my book, and since I never worked with sticky before I’m not totally sure if what I’m saying is correct. This is made worse by the fact that there are no very clear tutorials on sticky. That’s partly because it works pretty intuitively in most cases, and partly because the details can be complicated. So here’s my draft 1 of position: sticky. There will be something wrong with it; please correct me where needed. The inset properties are top, right, bottom and left. (I already introduced this terminology earlier in the chapter.) Introduction position: sticky is a mix of relative and fixed. A sticky box takes its normal position in the flow, as if it had position: relative, but if that position scrolls out of view the sticky box remains in a position defined by its inset properties, as if it has position: fixed. A sticky box never escapes its container, though. If the container start or end scrolls past the sticky box abandons its fixed position and sticks to the top or the bottom of its container. It is typically used to make sure that headers remain in view no matter how the user scrolls. It is also useful for tables on narrow screens: you can keep headers or the leftmost table cells in view while the user scrolls. Scroll box and container A sticky box needs a scroll box: a box that is able to scroll. By default this is the browser window — or, more correctly, the layout viewport — but you can define another scroll box by setting overflow on the desired element. The sticky box takes the first ancestor that could scroll as its scroll box and calculates all its coordinates relative to it. A sticky box needs at least one inset property. These properties contain vital instructions, and if the sticky box doesn’t receive them it doesn’t know what to do. A sticky box may also have a container: a regular HTML element that contains the sticky box. The sticky box will never be positioned outside this container, which thus serves as a constraint. The first example shows this set-up. The sticky <h2> is in a perfectly normal <div>, its container, and that container is in a <section> that is the scroll box because it has overflow: auto. The sticky box has an inset property to provide instructions. The relevant styles are: section.scroll-container { border: 1px solid black; width: 300px; height: 300px; overflow: auto; padding: 1em; } div.container { border: 1px solid black; padding: 1em; } section.scroll-container h2 { position: sticky; top: 0; } The rules Sticky header Regular content Regular content Regular content Regular content Regular content Regular content Regular content Content outside container Content outside container Content outside container Content outside container Content outside container Content outside container Now let’s see exactly what’s going on. A sticky box never escapes its containing box. If it cannot obey the rules that follow without escaping from its container, it instead remains at the edge. Scroll down until the container disappears to see this in action. A sticky box starts in its natural position in the flow, as if it has position: relative. It thus participates in the default flow: if it becomes higher it pushes the paragraphs below it downwards, just like any other regular HTML element. Also, the space it takes in the normal flow is kept open, even if it is currently in fixed position. Scroll down a little bit to see this in action: an empty space is kept open for the header. A sticky box compares two positions: its natural position in the flow and its fixed position according to its inset properties. It does so in the coordinate frame of its scroll box. That is, any given coordinate such as top: 20px, as well as its default coordinates, is resolved against the content box of the scroll box. (In other words, the scroll box’s padding also constrains the sticky box; it will never move up into that padding.) A sticky box with top takes the higher value of its top and its natural position in the flow, and positions its top border at that value. Scroll down slowly to see this in action: the sticky box starts at its natural position (let’s call it 20px), which is higher than its defined top (0). Thus it rests at its position in the natural flow. Scrolling up a few pixels doesn’t change this, but once its natural position becomes less than 0, the sticky box switches to a fixed layout and stays at that position. The sticky box has bottom: 0 Regular content Regular content Regular content Regular content Regular content Regular content Sticky header Content outside container Content outside container Content outside container Content outside container Content outside container Content outside container It does the same for bottom, but remember that a bottom is calculated relative to the scroll box’s bottom, and not its top. Thus, a larger bottom coordinate means the box is positioned more to the top. Now the sticky box compares its default bottom with the defined bottom and uses the higher value to position its bottom border, just as before. With left, it uses the higher value of its natural position and to position its left border; with right, it does the same for its right border, bearing in mind once more that a higher right value positions the box more to the left. If any of these steps would position the sticky box outside its containing box it takes the position that just barely keeps it within its containing box. Details Sticky header Very, very long line of content to stretch up the container quite a bit Regular content Regular content Regular content Regular content Regular content Regular content Content outside container Content outside container Content outside container Content outside container Content outside container Content outside container Content outside container The four inset properties act independently of one another. For instance the following box will calculate the position of its top and left edge independently. They can be relative or fixed, depending on how the user scrolls. p.testbox { position: sticky; top: 0; left: 0; } Content outside container Content outside container Content outside container Content outside container Content outside container The sticky box has top: 0; bottom: 0 Regular content Regular content Regular content Regular content Sticky header Regular content Regular content Regular content Regular content Regular content Content outside container Content outside container Content outside container Content outside container Content outside container Setting both a top and a bottom, or both a left and a right, gives the sticky box a bandwidth to move in. It will always attempt to obey all the rules described above. So the following box will vary between 0 from the top of the screen to 0 from the bottom, taking its default position in the flow between these two positions. p.testbox { position: sticky; top: 0; bottom: 0; } No container Regular content Regular content Sticky header Regular content Regular content Regular content Regular content Regular content Regular content Regular content Regular content Regular content So far we put the sticky box in a container separate from the scroll box. But that’s not necessary. You can also make the scroll box itself the container if you wish. The sticky element is still positioned with respect to the scroll box (which is now also its container) and everything works fine. Several containers Sticky header Regular content Regular content Regular content Regular content Regular content Regular content Regular content Content outside container Content outside container Content outside outer container Content outside outer container Or the sticky item can be several containers removed from its scroll box. That’s fine as well; the positions are still calculated relative to the scroll box, and the sticky box will never leave its innermost container. Changing the scroll box Sticky header The container has overflow: auto. Regular content Regular content Regular content Regular content Regular content Regular content Content outside container Content outside container Content outside container One feature that catches many people (including me) unaware is giving the container an overflow: auto or hidden. All of a sudden it seems the sticky header doesn’t work any more. What’s going on here? An overflow value of auto, hidden, or scroll makes an element into a scroll box. So now the sticky box’s scroll box is no longer the outer element, but the inner one, since that is now the closest ancestor that is able to scroll. The sticky box appears to be static, but it isn’t. The crux here is that the scroll box could scroll, thanks to its overflow value, but doesn’t actually do so because we didn’t give it a height, and therefore it stretches up to accomodate all of its contents. Thus we have a non-scrolling scroll box, and that is the root cause of our problems. As before, the sticky box calculates its position by comparing its natural position relative to its scroll box with the one given by its inset properties. Point is: the sticky box doesn’t scroll relative to its scroll box, so its position always remains the same. Where in earlier examples the position of the sticky element relative to the scroll box changed when we scrolled, it no longer does so, because the scroll box doesn’t scroll. Thus there is no reason for it to switch to fixed positioning, and it stays where it is relative to its scroll box. The fact that the scroll box itself scrolls upward is irrelevant; this doesn’t influence the sticky box in the slightest. Sticky header Regular content Regular content Regular content Regular content Regular content Regular content Regular content Content outside container Content outside container Content outside container Content outside container Content outside container Content outside container One solution is to give the new scroll box a height that is too little for its contents. Now the scroll box generates a scrollbar and becomes a scrolling scroll box. When we scroll it the position of the sticky box relative to its scroll box changes once more, and it switches from fixed to relative or vice versa as required. Minor items Finally a few minor items: It is no longer necessary to use position: -webkit-sticky. All modern browsers support regular position: sticky. (But if you need to cater to a few older browsers, retaining the double syntax doesn’t hurt.) Chrome (Mac) does weird things to the borders of the sticky items in these examples. I don’t know what’s going on and am not going to investigate. Full Article CSS for JavaScripters
y Redefining inclusivity By www.thehindu.com Published On :: Fri, 14 Jul 2023 01:25:17 +0530 Blind Bake and The Echoes are unique cafes that provide employment to specially abled people Full Article Food
y U.S. firm to upskill poor women in employable sectors By www.thehindu.com Published On :: Fri, 14 Jul 2023 09:30:12 +0530 Mohit Malik, COO, GSPANN Technologies, said the centre would also train the youth from the community in various employability-driven technical skills. Full Article Telangana