Angular πŸ‡ΊπŸ‡¦ - practical notes
1.63K subscribers
1.6K photos
1 file
532 links
Angular - practical notes

This group is for posting practical notes for Angular developers. Mostly all posts are for quick implementation https://t.me/angular_practical_notes (Commenting on posts only in ENG and UA langs here). Welcome!
Download Telegram
πŸ“„ 2/2 One-Liners Every Dev Needs to Know

#css

11. Automatic PDF Indicator

Automatically appends β€œ(PDF)” after links that point to PDF files, making it clear to users what type of file they’re about to download.


a[href$=".pdf"][download]::after { content: " (PDF)" }


12. Counting with CSS

The below piece of code creates a custom counter for list items, transforming them into a uniquely styled numbered list. This snippet uses the CSS counters to increment the list item number and display it before the item content:


.list { counter-reset: list-counter }
.item { counter-increment: list-counter }
.item::before { content: counter(list-counter) ". " }


13. Grayscale Image Hover

This piece of CSS applies a grayscale filter to images on hover, creating an elegant visual effect that reverts to full colour when the mouse is moved away.


img:hover { filter: grayscale(100%) }


14. Perfect Circles

With this one-liner, you can easily transform any element into a perfect circle.


.circle { clip-path: circle(50%) }


15. Blend Backgrounds

Mix the element’s background image with its background colour using the multiply blend mode, creating a rich, layered visual effect.


.blend-background { background-blend-mode: multiply }


16. Gradient Text

-webkit-background-clip: text leverages the power of CSS gradients and clips it to the text itself, making the text transparent and letting the gradient show through as its color.

.gradient-text {
background: linear-gradient(to top, red 0%, blue 100%);
color: transparent;
-webkit-background-clip: text;
}


17. First Line Emphasis

The ::first-line pseudo-element makes the first line of your paragraph stand out by making it bold and changing its colour.


p::first-line {
font-weight: bold;
color: #333;
}


18. Dynamic Sibling Influence

This CSS one-liner changes the style of a target element when you hover over its sibling.


.sibling:hover ~ .target { color: #007bff }
.sibling:hover + .target { color: #007bff }


19. Empty Element

This CSS trick automatically hides any element that has no content.


.element:empty { display: none }


20. Responsive Styling based on Orientation

It’s perfect for ensuring your design looks great in both portrait and landscape modes, especially on mobile devices where users might frequently change orientation.


@media (orientation: landscape) {
body {
background-color: #333
}
}


βœ… Article link
πŸ‘3❀1
πŸ€“ Clean Code JavaScript Tips for Efficient Programming

#js

βœ… Article link
πŸ‘2
πŸ“„ Web Service Workers in Angular

#angular #guide #serviceWorker

What is a Service Worker?
In Angular, a service worker is a script that runs in the background of a web application, separate from the main web page. It is a critical component for building Progressive Web Apps (PWAs) and enabling features like offline functionality, push notifications, and caching.


βœ… Article link
πŸ“„ Infinite Scroll Component in Angular

#angular #rxjs #ui_element #infiniteScroll

βœ… Article link 🎁 Code Link
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM