Skip to content

Instantly share code, notes, and snippets.

@SarahElson
SarahElson / test.js
Created May 24, 2024 07:09
How to Use sendKeys() in JavaScript
const { setupDriver } = require("./web-driver");
async function performSearch() {
const driver = await setupDriver();
try {
// Navigate to Google's homepage
await driver.get("<https://www.google.com/>");
// Find the search input element and send the search query
@SarahElson
SarahElson / Navbar.js
Created May 22, 2024 13:25
How to Use CSS Modules With React Applications
import NavLinks from '../NavLinks/NavLinks'
import Button from '../Button/Button'
import styles from './Navbar.module.css'
export default function Navbar() {
return (
<div className={styles.navbar}>
<div>
<p className={styles.logo}>LambdaTest</p>
@SarahElson
SarahElson / Card.js
Created May 21, 2024 04:21
How to Use CSS Modules With React Applications
//Import the styles in a JavaScript file
import styles from './Card.module.css'
//use it as an object
<div class={styles.card}>
{/* Code related to card */}
</div>
@SarahElson
SarahElson / Card.module.css
Created May 21, 2024 04:20
How to Use CSS Modules With React Applications
.card{
/* Styles related to the card */
}
@SarahElson
SarahElson / HeroImage.js
Created May 21, 2024 04:04
How to Use CSS Modules With React Applications
import styles from './HeroImage.module.css'
export default function HeroImage() {
return (
<div className={styles.half}>
<img className={styles.image} src='https://www.lambdatest.com/resources/images/main/home_banner.webp' />
</div>
)
}
@SarahElson
SarahElson / HeroText.module.css
Created May 21, 2024 04:02
How to Use CSS Modules With React Applications
.half{
width: 50%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: start;
gap: 1.5rem;
}
.leading{
font-size: 3rem;
@SarahElson
SarahElson / HeroText.js
Created May 21, 2024 04:01
How to Use CSS Modules With React Applications
import React from 'react'
import styles from './HeroText.module.css'
import Button from '../Button/Button'
export default function HeroText() {
return (
<div className={styles.half}>
<h1 className={styles.leading}>Next-Generation Mobile Apps and Cross Browser Testing Cloud</h1>
<div className={styles.buttoncontainer}>
@SarahElson
SarahElson / HeroSection.module.css
Created May 21, 2024 03:59
How to Use CSS Modules With React Applications
.section{
display: flex;
flex-direction: row;
min-height: 100vh;
width: 100%;
padding: 5rem;
}
@SarahElson
SarahElson / HeroSection.js
Created May 21, 2024 03:58
How to Use CSS Modules With React Applications
import React from 'react'
import HeroImage from '../HeroImage/HeroImage'
import HeroText from '../HeroText/HeroText'
import styles from './HeroSection.module.css'
export default function HeroSection() {
return (
<section className={styles.section}>
<HeroText />
@SarahElson
SarahElson / Button.module.css
Created May 21, 2024 03:57
How to Use CSS Modules With React Applications
.button{
padding: 10px 20px;
border: none;
border-radius: 10px;
margin: 0 10px;
}
.primary{
composes:button;
background: linear-gradient(91.88deg,#2c57f3 .88%,#a506d8 98.71%);
color: white;