Compare commits

...

1 Commits

Author SHA1 Message Date
BordedDev
9089589d36 Made input styling shared 2025-03-09 14:07:50 +00:00
5 changed files with 78 additions and 50 deletions

View File

@ -1,3 +1,5 @@
@import "shared.css";
* {
margin: 0;
box-sizing: border-box;
@ -342,4 +344,3 @@ a {
.sidebar ul li a:hover {
color: #fff;
}

View File

@ -21,6 +21,24 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
const getAdoptionStyles = () => {
return Array.from(document.styleSheets)
.filter((styleSheet) => styleSheet.href?.endsWith("shared.css"))
.map(x => {
const sheet = new CSSStyleSheet();
sheet.replaceSync(Array.from(x.cssRules).flatMap(rule => {
if (rule instanceof CSSImportRule) {
return Array.from(rule.styleSheet.cssRules).map(rule => rule.cssText);
} else {
return rule.cssText;
}
}).join(' '));
return sheet;
});
}
class GenericField extends HTMLElement {
form = null;
field = null;
@ -83,18 +101,6 @@ class GenericField extends HTMLElement {
background-color: #1a1a1a;
color: #e6e6e6;
font-size: 1em;
&:focus {
outline: 2px solid #f05a28 !important;
}
&::placeholder {
transition: opacity 0.3s;
}
&:focus::placeholder {
opacity: 0.4;
}
}
button {
@ -155,6 +161,9 @@ class GenericField extends HTMLElement {
this.container.appendChild(this.styleElement);
this.shadowRoot.appendChild(this.container);
this.shadowRoot.adoptedStyleSheets = getAdoptionStyles();
}
connectedCallback() {

View File

@ -0,0 +1,15 @@
input, textarea {
&:focus {
outline: 2px solid #f05a28 !important;
}
&::placeholder {
transition: opacity 0.3s;
}
&:focus::placeholder {
opacity: 0.4;
}
}

View File

@ -1,55 +1,57 @@
@import "shared.css";
* {
box-sizing: border-box;
box-sizing: border-box;
}
.dialog {
background-color: #0f0f0f;
border-radius: 10px;
padding: 30px;
width: 800px;
margin: 30px;
box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}
@media screen and (max-width: 500px) {
.center {
width: 100%;
left: 0px;
}
.dialog {
background-color: #0f0f0f;
border-radius: 10px;
padding: 30px;
width: 800px;
margin: 30px;
box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}
@media screen and (max-width: 500px) {
.center {
width: 100%;
left: 0px;
}
.dialog {
width: 100%;
left: 0px;
}
width: 100%;
left: 0px;
}
}
h1 {
font-size: 2em;
color: #f05a28;
margin-bottom: 20px;
font-size: 2em;
color: #f05a28;
margin-bottom: 20px;
}
h2 {
font-size: 1.4em;
color: #f05a28;
margin-bottom: 20px;
font-size: 1.4em;
color: #f05a28;
margin-bottom: 20px;
}
body {
font-family: Arial, sans-serif;
background-color: #1a1a1a;
color: #e6e6e6;
line-height: 1.5;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
min-height: 100vh;
font-family: Arial, sans-serif;
background-color: #1a1a1a;
color: #e6e6e6;
line-height: 1.5;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
min-height: 100vh;
}
div {
text-align: left;
text-align: left;
}

View File

@ -20,6 +20,7 @@
<script src="/html-frame.js"></script>
<script src="/generic-form.js"></script>
<link rel="stylesheet" href="/html-frame.css">
<link rel="stylesheet" href="/shared.css">
{% block head %}
{% endblock %}