<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.0/beautify-css.min.js"></script>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSS Beautifier</title>
<link rel="stylesheet" href="styles.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-beautify/1.14.0/beautify-css.min.js"></script>
</head>
<body>
<div class="container">
<h1>CSS Beautifier</h1>
<textarea id="input-css" placeholder="Paste your CSS here..."></textarea>
<div class="buttons">
<button id="beautify-btn">Beautify</button>
<button id="copy-btn">Copy</button>
<button id="download-btn">Download</button>
<button id="theme-toggle">🌙</button>
</div>
<textarea id="output-css" readonly placeholder="Formatted CSS will appear here..."></textarea>
</div>
<script src="script.js"></script>
</body>
</html>
/* General Styles */
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background: #f4f4f4;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
transition: background 0.3s ease;
}
/* Container */
.container {
background: white;
padding: 20px;
border-radius: 10px;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
width: 90%;
max-width: 600px;
text-align: center;
}
/* Heading */
h1 {
margin-bottom: 15px;
color: #333;
}
/* Textareas */
textarea {
width: 100%;
height: 150px;
padding: 10px;
font-size: 14px;
border: 1px solid #ccc;
border-radius: 5px;
resize: none;
}
/* Buttons */
.buttons {
display: flex;
justify-content: space-between;
margin: 15px 0;
}
button {
padding: 10px 15px;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 14px;
transition: 0.3s;
}
#beautify-btn { background: #28a745; color: white; }
#copy-btn { background: #007bff; color: white; }
#download-btn { background: #ff9800; color: white; }
#theme-toggle { background: #333; color: white; }
button:hover {
opacity: 0.8;
}
/* Dark Mode */
.dark-mode {
background: #222;
color: white;
}
.dark-mode .container {
background: #333;
}
.dark-mode h1 {
color: white;
}
.dark-mode textarea {
background: #444;
color: white;
border: 1px solid #666;
}
.dark-mode button {
background: #666;
}
/* Responsive */
@media (max-width: 500px) {
.buttons {
flex-direction: column;
}
button {
margin-bottom: 10px;
}
}
/* General Styles */
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background: #f4f4f4;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
transition: background 0.3s ease;
}
/* Container */
.container {
background: white;
padding: 20px;
border-radius: 10px;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
width: 90%;
max-width: 600px;
text-align: center;
}
/* Heading */
h1 {
margin-bottom: 15px;
color: #333;
}
/* Textareas */
textarea {
width: 100%;
height: 150px;
padding: 10px;
font-size: 14px;
border: 1px solid #ccc;
border-radius: 5px;
resize: none;
}
/* Buttons */
.buttons {
display: flex;
justify-content: space-between;
margin: 15px 0;
}
button {
padding: 10px 15px;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 14px;
transition: 0.3s;
}
#beautify-btn { background: #28a745; color: white; }
#copy-btn { background: #007bff; color: white; }
#download-btn { background: #ff9800; color: white; }
#theme-toggle { background: #333; color: white; }
button:hover {
opacity: 0.8;
}
/* Dark Mode */
.dark-mode {
background: #222;
color: white;
}
.dark-mode .container {
background: #333;
}
.dark-mode h1 {
color: white;
}
.dark-mode textarea {
background: #444;
color: white;
border: 1px solid #666;
}
.dark-mode button {
background: #666;
}
/* Responsive */
@media (max-width: 500px) {
.buttons {
flex-direction: column;
}
button {
margin-bottom: 10px;
}
}
