The today over lesson is about the CSS: CurrentColor: What the heck Is the CI/CD? I hope this lesson useful for you.

CSS: CurrentColor:

Description

CurrentColor is the value of the color property. The used value of the currentColor keyword is the computed value of the color property. If the currentColor keyword is set on the color property itself, it’s treated as color: inherit;

w3.ogr/TR/css-color-3/#currentcolor

Example

body { color: #333; } // set the color to the parent

div{
	border: 2px solid currentColor; // #333 is applied
	box-shadow: 5px 5px 10px currentColor; // #333
	background: linear-gradient(
		to bottom right,
		currentColor, // #333
		#999
	);
	
	// Can be also applied to pseudo elements:
	&:after{
		border: 1px solid currentColor; // #333
	}
}
// SVG understands it too;
svg{
	color: currentColor; // #333
	fill: currentColor: // #333
}

What the Heck Is the CI/CD?

Continuous Integration (CI) and Continuous Delivery (CD) embody a culture, set of operating principles, and collection of practices that enable application development teams to deliver code changes more frequently and reliably. The implementation is also known as the CI/CD pipeline.

Main benefites of using CI/CD:

  • Reduce the manual work by automating processes
  • Improve the overall product’s quality
  • Make your application ready for scaling
  • Earlier detection and prevention of defects

Some (most popular) CI/CD platforms:

  • GitHub Actions
  • Jenkins
  • Travis CI
  • CircleCI
  • AWS CodeBuild Azure DevOps
  • Atlassian Bamboo

—————————————————————————————–

In Addition 1.

JavaScript: masking credit car number

function maskCC(number){
	// let's return undefined when the format isn't valid
	if(!(
		typeof number === 'string'
		&& number.length === 16
		&& number.split('').map(Number)
		.every(n => !isNaN(n))
	)){
		return;
	}
	
	return [
		...new Array(3).fill('****'),number.slice(-4),].join('-');
}
console.log(maskCC(1234567887654321));
// '****-****-****-4321'
console.log(maskCC('aaaaaaaaaaaaaa'));
// undefined              // @room_js

—————————————————————————————–

In Addition 1.

JavaScript: format phone number

function formatPhone(
	number,
	format = 'xxx-xxx-xxx' // default value
)	{
	let result = ''; let curIndex = 0;
	format.split('').forEach(char => {
		if(char.toLowerCase() === 'x'){
			result += number.charAt(curIndex);
			curIndex++;
		} else{
			result += char;
		}
	});
	return result;
}

console.log(formatPhone(123456789));
// 123-456-789
console.log(formatPhone('987654321', 'XXX-XX-XX-XX')); 
// 987-65-43-21

—————————————————————————————–

I hope you benefited from this course. I wish everyone success in these difficult days, and we hope that this corona virus ends early, wash it frequently in your hands. #Stay At Home

Soruce: roomjs.com