Skip to content

Instantly share code, notes, and snippets.

@SarahElson
SarahElson / Button.js
Created May 21, 2024 03:56
How to Use CSS Modules With React Applications
import React from 'react'
import styles from './Button.module.css'
export default function Button({text,type}) {
return (
<button className={styles.button + " " + styles[type]}>{text}</button>
)
}
@SarahElson
SarahElson / Navlinks.module.css
Created May 21, 2024 03:55
How to Use CSS Modules With React Applications
@SarahElson
SarahElson / Navlinks.js
Created May 21, 2024 03:53
How to Use CSS Modules With React Applications
@SarahElson
SarahElson / Navlinks.js
Created May 20, 2024 17:13
How to Use CSS Modules With React Applications
@SarahElson
SarahElson / Navbar.module.css
Created May 20, 2024 17:11
How to Use CSS Modules With React Applications
.navbar{
display: flex;
flex-direction: row;
height: 10vh;
padding:0 5rem;
justify-content: space-between;
align-items: center;
position: absolute;
top: 0;
left: 0;
@SarahElson
SarahElson / App.module.css
Created May 20, 2024 16:26
How to Use CSS Modules With React Applications
.app{
min-height: 100vh;
background-color: #fafafa;
width: 100%;
position: relative;
}
@SarahElson
SarahElson / App.js
Created May 20, 2024 16:25
How to Use CSS Modules With React Applications
import styles from './App.module.css'
import HeroSection from './components/HeroSection/HeroSection';
import Navbar from './components/Navbar/Navbar';
function App() {
return (
<div className={styles.app}>
<Navbar />
<HeroSection />
//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>
.card{
/* Styles related to the card */
}
@SarahElson
SarahElson / test_wait_url_navigation.py
Created May 9, 2024 12:15
How to Use Playwright Wait For Navigation Methods
from playwright.sync_api import expect
from fixtures.wait_fixture import page, browser, set_test_status
import re
def test_wait_url_navigation(page, set_test_status):
page.goto("https://ecommerce-playground.lambdatest.io/")
page.get_by_role("link", name="Blog", exact=True).click()