Skip to content

Instantly share code, notes, and snippets.

View VihangaN's full-sized avatar
🏠
Working from home

Vihanga nivarthana VihangaN

🏠
Working from home
View GitHub Profile
/* overriding theme class to align icons properly */
a.sf-sub-menu__link {
display: flex;
gap:1rem;
align-items: center;
}
/* icon styles */
@VihangaN
VihangaN / main.css
Created September 7, 2022 07:01
css source code for the hashnode duotone article
@font-face {
font-family: "duotone";
src: url("duotone-Regular.ttf") format("truetype"),
url("duotone-Regular.woff") format("woff");
font-weight: normal;
font-style: normal;
font-display: block;
}
[class^="icon-"],
@VihangaN
VihangaN / Final.jsx
Last active November 19, 2020 19:00
import React, { useState } from "react";
export default function App() {
let [isOn, setOn] = useState(false);
const toggle = (e) => {
if (e.target.checked) {
setOn(true);
} else {
setOn(false);
@VihangaN
VihangaN / style.css
Created November 19, 2020 18:11
css styles for the toggle switch
.slider{
position: relative;
width:100px;
height: 50px;
display: inline-block;
cursor: pointer;
margin:0px 10px 0px 10px;
transform: scale(0.7);
}
@VihangaN
VihangaN / toggle.jsx
Created November 19, 2020 17:36
Toggle switch's layout
<label className="slider" >
<input type="checkbox"/>
<div className="sort"></div>
</label>