Material Design - Switch
How do I make an material design - switch?
A simple material design switch in sass, with toggle hide show without js. What is a material design - switch? How do you make a material design - switch? This script and codes were developed by Lorenzo D'Ianni on 29 September 2022, Thursday.
Material Design - Switch - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Material Design - Switch</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <h1>Switch in Sass</h1>
<input type="checkbox" id="id-name--1" name="set-name" class="switch-input">
<label for="id-name--1" class="switch-label">Switch <span class="toggle--on">On</span><span class="toggle--off">Off</span></label>
</body>
</html>
Material Design - Switch - Script Codes CSS Codes
@import url(https://fonts.googleapis.com/css?family=Roboto:300,500);
* { margin: 0; padding: 0; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; box-sizing: border-box;
}
html { position: relative; height: 100%; min-height: 100%;
}
body { position: absolute; top: 50%; left: 50%; font-family: 'Roboto', sans-serif; font-size: 14px; text-align: center; color: rgba(0, 0, 0, 0.64); padding: 32px; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);
}
h1 { font-size: 42px; font-weight: 300;
}
.switch-input { display: none;
}
.switch-label { position: relative; display: inline-block; min-width: 112px; cursor: pointer; font-weight: 500; text-align: left; margin: 16px; padding: 16px 0 16px 44px;
}
.switch-label:before, .switch-label:after { content: ""; position: absolute; margin: 0; outline: 0; top: 50%; -webkit-transform: translate(0, -50%); transform: translate(0, -50%); -webkit-transition: all 0.3s ease; transition: all 0.3s ease;
}
.switch-label:before { left: 1px; width: 34px; height: 14px; background-color: #9E9E9E; border-radius: 8px;
}
.switch-label:after { left: 0; width: 20px; height: 20px; background-color: #FAFAFA; border-radius: 50%; box-shadow: 0 3px 1px -2px rgba(0, 0, 0, 0.14), 0 2px 2px 0 rgba(0, 0, 0, 0.098), 0 1px 5px 0 rgba(0, 0, 0, 0.084);
}
.switch-label .toggle--on { display: none;
}
.switch-label .toggle--off { display: inline-block;
}
.switch-input:checked + .switch-label:before { background-color: #A5D6A7;
}
.switch-input:checked + .switch-label:after { background-color: #4CAF50; -webkit-transform: translate(80%, -50%); transform: translate(80%, -50%);
}
.switch-input:checked + .switch-label .toggle--on { display: inline-block;
}
.switch-input:checked + .switch-label .toggle--off { display: none;
}
Developer | Lorenzo D'Ianni |
Username | lorenzodianni |
Uploaded | September 29, 2022 |
Rating | 4.5 |
Size | 3,282 Kb |
Views | 24,288 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Material Design - Animations | 9,001 Kb |
AngularJS - Controller As | 5,584 Kb |
Checkbox Style 2.0 - SCSS | 4,075 Kb |
Material Design - Button in pure CSS | 3,923 Kb |
Off Canvas in SASS | 5,680 Kb |
Ng-barcode | 2,888 Kb |
Smooth Scroll | 3,561 Kb |
AngularJS template | 6,104 Kb |
Cards experience | 10,660 Kb |
Checkbox Style - SCSS | 5,095 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Wikipedia API | Coderpilot | 2,802 Kb |
Responsive Section hover effect to show content | Berdejitendra | 2,540 Kb |
Zeichensatz | Moklick | 2,058 Kb |
Blockquote design | Sjmcpherson | 1,863 Kb |
Resume | Rottingroom | 5,483 Kb |
A Pen by Jim Savage | Madebyjam | 2,418 Kb |
CSS Grid Test | Ajaykarwal | 2,377 Kb |
CSS3 keyframe onload animation. | Samueljseay | 1,706 Kb |
Pure CSS Tooltip | APinix | 2,815 Kb |
Double box-shadow | Daubac402 | 1,436 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!