Global CSS options with custom properties

With a preprocessor, like Sass, building a logical “do this or don’t” setting is fairly straightforward:

$option: false;

@mixin doThing {
  @if $option {
    do-thing: yep;
  }
}

.el {
  @include doThing;
}

Can we do that in native CSS with custom properties? Mark Otto shows that we can. It’s just a smidge different.

html {
  --component-shadow: 0 .5rem 1rem rgba(0,0,0,.1);
}

.component {
  box-shadow: var(--component-shadow);
}

<!-- override the global anywhere more specific! like
     <div class="component remove-shadow">
     or
     <body class="remove-shadow"> -->
.remove-shadow {
  --component-shadow: none;
}

Direct Link to ArticlePermalink

The post Global CSS options with custom properties appeared first on CSS-Tricks.

Drupal 9 Essentials

Drupal is an open-source content management system used by developers to create websites and online applications. Its numerous configuration options and extensions enable developers to dedicate more time to feature enhancements and system integrations. This Refcard introduces the core features and illustrates how a developer can use pre-defined, secure functionality to create complex data collection and delivery solutions.

Microsoft Edge Receives Spellcheck Upgrade

Microsoft’s Chromium-based Edge browser will gain an all-new mechanism for spellcheck in version 83. The new feature, which is powered by Windows Spellcheck, will be available on all systems using Windows 8.1 and above.

Error Handling in Spring Webflux

The topic of error handling in web applications is very important. From a client perspective it is essential to know on how was the request proceeded and in case of any error is crucial to provide to the client a valid reason, especially if the error was due to the client’s actions. There are different situations, when notifying callers about concrete reasons is important – think about server-side validations, business logic errors that come due to bad requests or simple not found situations.

The mechanism of error handling in Webflux is different, from what we know from Spring MVC. Core building blocks of reactive apps – Mono and Flux brings a special way to deal with error situations, and while old exception-based error handling still may work for some cases, it violates Spring Webflux nature. In this post I will do an overview of how to process errors in Webflux when it comes to business errors and absent data. I will not cover technical errors in this article, as they are handled by Spring framework.

Step-by-Step: iSCSI Target Server Cluster in Azure

I recently helped someone build an iSCSI target server cluster in Azure and realized that I never wrote a step-by-step guide for that particular configuration. So to remedy that, here are the step-by-step instructions in case you need to do this yourself.

Prerequisites

I'm going to assume you are fairly familiar with Azure and Windows Server, so I'm going to spare you some of the details. Let's assume you have at least done the following as a pre-requisite

Prometheus vs. CloudWatch for Cloud Native Applications

Many companies are moving to Kubernetes as the platform of choice for running software workloads. When an organization earlier using VMs in AWS decides to move to Kubernetes (Either EKS or self-managed in AWS), one of the questions that come up is, should one continue to use CloudWatch or switch to some other tool like Prometheus? While it is not an exactly apple to apple comparison, there are reasons to explore this and choose tooling that is built for the future. This post will try to explore various aspects and pros and cons of both options individually and as a combination.

Why?

Prometheus and CloudWatch are very different in the problem they solve, and a 1:1 comparison seems unfair, but as you start moving to cloud-native stack, Prometheus starts popping up in conversations and for many right reasons. For example, currently, CloudWatch does not support Kubernetes metrics (Issue link here). As one of the workarounds, you can use CloudWatch exporter and export metrics from CloudWatch to a Prometheus instance. You can also host a Prometheus instance in the cluster, and then metrics are exported to CloudWatch using the CloudWatch adapter. Before we start comparing the two technologies, let's do a quick high-level overview of both.

Building AMQP-Based Messaging Framework on MongoDB

Introduction

In any integration scenarios, messaging needs are inevitable. There are several messaging frameworks /tools/technology available today to chose from. Starting from old MQ we have come a long way to the world of open source-based technologies like Kafka, RabbitMQ, ActiveMQ, etc. Every other messaging frameworks came due to certain needs. With the growing trends of microservices, engineers are looking for more lightweight, independently deployable, and less costly options in the market. Every messaging framework comes with the baggage of additional infrastructure and maintenance headache. In one of my projects there has been a proposal to use the capped collection feature of MongoDB along with its tailable cursor as an alternative option to deploy any real messaging infrastructure. Now the question arises,

  • Is this option suitable for all kind of messaging needs?
  • Can it be a replacement of proper messaging framework like Kafka, RabbitMQ, etc.?
  • What are the pitfalls?

Not to mention that this feature of MongoDB is quite old and well-known in the market and you will find a lot of articles around it. However, I believe those articles have just shown the basic way of enabling it without going deep into it. A real messaging framework has lots of challenges than just making an asynchronous way of delivering the messages. In this series of articles, we will try to address them and see if we can really build some messaging infrastructure using MongoDB by considering all the needs of a messaging framework.

Executing Stringified Source Code in Java 8 and Later

Executing stringified source code in Java is hard to realize with only jdk core libraries but, if we are going to use the CodeExecutor of Burningwave Core, the task will become simple and we can accomplish it in one of three different ways that we can choose:

  • through BodySourceGenerator
  • through a property located in Burningwave configuration file
  • through a property located in a custom Properties file

Executing Code With BodySourceGenerator

For the first way, we must create a ExecuteConfig by using the within static method forBodySourceGenerator to which must be passed the BodySourceGenerator that contains the source code with the parameters used within: after that we must pass the created configuration to the execute method of CodeExecutor as shown below:

What Is a Sniffing Attack?

Introduction

In this article, we will be discussing what is a sniffing attack and how you can save yourself or an organization from a sniffing attack. We will also cover some tools that can be used to perform sniffing and recover information. Sniffing in general terms refers to investigate something covertly in order to find confidential information. From an information security perspective, sniffing refers to tapping the traffic or routing the traffic to a target where it can be captured, analyzed, and monitored. Sniffing is usually performed to analyze network usage, troubleshooting network issues, monitoring the session for development and testing purposes. Since we have understood what basically sniffing is, let’s move on to know how it can be used to perform attacks.

By the end of this, you will be able to understand what is Sniffing attack and its role in extracting meaningful insights from the complex and large sets of data all around us. To get in-depth knowledge of Ethical Hacking, you can enroll for a live ethical hacking course by OnlineITGuru with 24/7 support and lifetime access.

Gutenberg 8.2 Includes Editing Flow Improvements, Cover Block Content Positioning, and Pattern Categories

On Wednesday, the development team behind Gutenberg dropped version 8.2 of the plugin. The new release focuses on a better editing flow, includes a new content positioning control for the Cover block, and adds categories to block patterns.

With this release, users can copy an entire block via the Ctrl + C keyboard shortcut or cut a block with Ctrl + X if no specific text is selected. The snackbar popup will appear at the bottom of the screen to show which block was copied.

Hitting the Enter key while editing an image caption will create a new paragraph. For situations where a user wants to continue writing after inserting an image and caption, this is probably a welcome addition. However, it could be a problem for users who need to have multi-line captions — I am uncertain how to add a line break in a caption with this change.

Gutenberg 8.2 includes several other enhancements, such as limiting the most-used blocks in the inserter to six items. Individual buttons within the Buttons block can be split into two buttons by hitting the Enter key or merged by hitting the Backspace key. Users can also test two new block patterns. One adds a hero section with two columns beneath. The other adds a three-column features/services section.

Overall, this is a solid update with numerous enhancements and bug fixes. The editing flow changes are nice improvements, and the new Cover block positioning and Patterns API updates are welcome additions to the editor.

Content Positioning for the Cover Block

The Gutenberg team has created a new alignment control that allows end-users to position the content within the Cover block. I have been waiting for this feature for at least a year after first seeing it mentioned as a possibility in an unrelated ticket.

The new positioning feature adds a matrix control with nine positions the user can choose from. Once a position is chosen, the inner content of the Cover block will move to that location. It is important to note that some content will not look like it has changed position if the Cover block is full. The inner container’s width is set to auto, which means the content inside may already be taking up all the available space. Alignment is more pronounced in Cover blocks with less content inside.

Sure, it was possible to align inner blocks individually in past versions of the plugin. However, it was also sometimes a bit of pain to do on the block level. This new control brings a new level of flexibility to the Cover block.

Theme authors will need to update the CSS in their themes to handle the new positioning classes. There does not seem to be any official documentation for styling these classes, so looking at the source code is the best course of action. The classes are as follows:

.has-custom-content-position
.is-position-top-left
.is-position-top-center
.is-position-top-right
.is-position-center-left
.is-position-center-center
.is-position-center-right
.is-position-bottom-left
.is-position-bottom-center
.is-position-bottom-right

It will also be interesting to see what plugin developers do with the new AlignMatrixControl component for their own blocks. This component is used for handling the inner block alignment of the Cover block, but it should be easy to extend to other blocks that could also use such alignment.

Categories for Patterns

Gutenberg 8.2 has nearly ticked all my boxes for the Patterns API. The newest release adds support for categorizing patterns. Currently, the default interface shows the following seven categories:

  • Text
  • Hero
  • Columns
  • Buttons
  • Gallery
  • Features
  • Testimonials

There is also an “Uncategorized” section at the bottom of the inserter, but it is not technically a category. It merely houses any patterns that have not been categorized.

Theme and plugin authors now have access to the register_block_pattern_category() and unregister_block_pattern_category() functions to register or unregister patterns, respectively. Categories can be assigned to a specific block via the new categories argument. More information is available via the Patterns API documentation.

Patterns can be assigned one or multiple categories. Therefore, users may see duplicates of some patterns in the inserter. This is one reason I am holding out hope for the team to bring the tabbed interface or something similar back to the inserter. With categories, that should now be possible for both blocks and patterns. At the moment, my library of patterns is becoming unwieldy.

Slash commands for patterns are still on my wish list, which may cancel the need for a tabbed inserter interface.

Block Widgets Almost Ready

In this week’s editor chat, the team discussed the possibility of bringing the new Widgets screen out of the experimental stage. If this happens before July 7, it could mean users might be able to start configuring their sidebars with blocks as early as WordPress 5.5. This is not set in stone yet, but it is exciting to start seeing blocks truly break out of the post content area.

For the most part, the block-based widgets system works well. It does not yet feel as polished as it should be for merging into core WordPress. However, if the team pushes through any remaining roadblocks in the next month, it is within the realm of possibility. I have my doubts, but we’ll see where this lands soon.

Now is a good time for end-users to begin testing the experimental widgets via both the “Widgets (beta)” admin screen and the “Widgets Blocks (Experimental)” customizer panel. To test this feature, enable the Widgets option under the Experiments settings page for the Gutenberg plugin.

Leaning Towards Reactive Architecture

Why Reactive Architecture?

Reactive Architecture aims to provide software that remains responsive in all situations. Reactive Systems build user confidence by ensuring that the application is available whenever the users need it in all conditions.

What Is the Goal of Reactive Architecture?

  • Be responsive to interactions with its users
  • Handle failure and remain available during outages
  • Strive under varying load conditions
  • Be able to send, receive, and route messages in varying network conditions

What Is Reactive Manifesto?

The Reactive Manifesto is a document that was authored by Jonas Boner, Dave Farley, Roland Kuhn and Martin Thompson. The Manifesto was created in response to companies trying to cope with changes in the software landscape. Multiple groups or companies independently developed similar patterns for solving similar solutions. So aspects of a Reactive Systems were previously individually recognized by these groups. So the Manifesto attempts to bring all of these common ideas into a single unified set of principles, known as Reactive Principles.

Motion Layout API Leads Android Studio 4 Features

Google this week released Android Studio 4, the newest version of its core Android developer environment. Android Studio 4 is meant to give developers more tools so they can design and build apps faster and smarter. The platform arrives mere days before the Android 11 beta launch, which is expected on June 11. Google pushed back the launch of Android 11 in response to COVID-19. Android Studio 3.6 arrived in February.

Strapi Community Edition Now Generally Available

Strapi, an open-source headless CMS, has announced the general availability of the Strapi Community Edition. The project has been five years in the making, and the company is excited to see continued growth in the Strapi community now that it's generally available. In a blog post announcement, the Strapi team recapped the journey thus far, which includes over 1 million downloads, over 400 contributors, and almost 5,000 Strapi community projects on GitHub.

Google Search to Introduce New Page Experience Ranking Signal in 2021

Google is preparing to introduce a new ranking signal for Search, based on page experience as measured by Core Web Vitals metrics. This includes factors like page speed, responsiveness, and the stability of content as it loads. The upcoming update will combine these signals with previously announced UX-related signals for mobile-friendliness, safe browsing, HTTPS security, and intrusive interstitials.

Google is also updating its requirements for the Top Stories feature. It will no longer be limited to AMP pages – any content will be eligible:

As part of this update, we’ll also incorporate the page experience metrics into our ranking criteria for the Top Stories feature in Search on mobile, and remove the AMP requirement from Top Stories eligibility. Google continues to support AMP, and will continue to link to AMP pages when available. We’ve also updated our developer tools to help site owners optimize their page experience.

Mobile friendliness, HTTPS, and other UX signals listed in this update have long been included in best practices for WordPress sites. The Core Web Vitals items are a newer area that site owners will want to dig into when preparing for the new page experience signal.

Measuring things like the unexpected layout shift of visible page content and the experience users get when first interacting with a page are not easy. In anticipation of this ranking signal update, Google has updated the Lighthouse and PageSpeed Insights tools to give information and recommendations on a site’s Core Web Vitals. Google Search Console also provides a dedicated report, and developers can also get more information from Chrome DevTools, web.dev’s measure tool, and the Web Vitals Chrome extension. There are also several WordPress plugins that incorporate some of these tools, notably Site Kit by Google and Google Pagespeed Insights.

While this is a major change to ranking, Google noted that it will still prioritize pages with the best information overall. Better page experience scores will help a site rank better among multiple pages with similar content.

Developers who focus on delivering a high quality user experience reacted positively to Google’s announcement, since this means that UX work is getting validated as a valuable aspect of a site’s ranking.

Google plans to put the ranking changes into place sometime in 2021 and will provide at least six months notice before rolling out the update. This will give site owners time to improve their scores on the various page experience metrics. The company also plans to add more page experience signals on a yearly basis.