2024-10-24 21:31:16 +00:00
@use " common " ; // Reset styles
@use " colors " as * ; // Color scheme for Add New User page
// Basic styling for the body
body {
2024-10-25 11:13:15 +00:00
font-family : ' Arial ' , sans-serif ;
background : $add-user-background-color ; // Use background gradient for the page
display : flex ;
justify-content : center ; // Center the form horizontally
align-items : center ; // Center the form vertically
height : 100 % ;
padding : 20 px ; // Add some padding for mobile responsiveness
2024-10-24 21:31:16 +00:00
2024-10-25 11:13:15 +00:00
// Container for the form
. form-container {
background-color : $add-user-form-background ; // Form background color
padding : 40 px ;
border-radius : 12 px ; // Rounded corners for the form
box-shadow : 0 8 px 15 px $add-user-form-shadow-color ;
width : 100 % ;
max-width : 800 px ; // Increase the maximum width for a wider form
text-align : left ; // Left-align text
margin : auto ;
2024-10-24 21:31:16 +00:00
2024-10-25 11:13:15 +00:00
// Form header
h2 {
color : $add-user-form-title-color ; // Form title color
font-size : 28 px ;
margin-bottom : 20 px ;
text-align : left ;
display : block ;
2024-10-24 21:31:16 +00:00
}
2024-10-25 11:13:15 +00:00
// Form element
form {
display : flex ;
flex-wrap : wrap ; // Allow wrapping for form groups
gap : 20 px ; // Add consistent gap between elements
margin-bottom : 20 px ; // Add space below the form for submit button
// Form groups for each input
. form-group {
flex : 1 1 calc ( 50 % - 20 px ) ; // Take up half the row, accounting for gap
min-width : 250 px ; // Minimum width to prevent shrinking too much
// Label styling
label {
display : block ;
color : $add-user-form-title-color ;
font-size : 16 px ;
margin-bottom : 5 px ;
}
// Input and select styling
input [ type = " text " ] ,
input [ type = " password " ] ,
input [ type = " email " ] ,
input [ type = " date " ] ,
input [ type = " number " ] ,
input [ type = " datetime-local " ] ,
input [ type = " tel " ] ,
select {
width : 100 % ; // Full width of the form group
padding : 12 px ;
border : 1 px solid $add-user-input-border-color ; // Input field border color
border-radius : 6 px ;
background-color : $add-user-input-background ; // Input background color
font-size : 16 px ;
transition : border-color 0 .3 s , background-color 0 .3 s ;
& : focus {
border-color : $add-user-input-focus-border-color ; // Focus border color
outline : none ;
}
}
}
. admin-access {
label {
display : block ;
color : $add-user-form-title-color ;
font-size : 16 px ;
margin-bottom : 5 px ;
}
. checkbox-group {
display : flex ;
gap : 10 px ;
// Hide the checkboxes
input [ type = " checkbox " ] {
display : none ;
}
// Style the label as a button to match input fields
label . checkbox {
cursor : pointer ;
padding : 12 px ; // Match the padding with the input fields
border : 1 px solid $user-form-checkbox-button-border-color ; // Use the same border style
border-radius : 6 px ; // Match the border radius with other inputs
background-color : $add-user-input-background ; // Use the same background color
font-size : 16 px ; // Font size consistency
text-align : center ;
width : 100 % ; // Make the label full-width
transition : background-color 0 .3 s , color 0 .3 s , border-color 0 .3 s ;
user-select : none ;
// Change background when active or focused
& : hover ,
& : focus {
background-color : $user-form-checkbox-button-hover-color ;
border-color : $user-form-checkbox-button-hover-border-color ; // Use focus border color
}
}
// Change styles when the checkbox is checked
input [ type = " checkbox " ] : checked + label . checkbox {
background-color : $user-form-checkbox-button-active-color ;
color : $user-form-checkbox-button-active-text-color ;
border-color : $user-form-checkbox-button-active-border-color ;
}
}
}
// Dropdown Menu for Admin Role
. role-dropdown {
flex : 1 1 calc ( 50 % - 20 px ) ; // Explicitly set to half width, considering gap
min-width : 250 px ; // Minimum width to avoid shrinking too much
padding : 0 ; // Reset any padding
}
. radio-group {
display : flex ;
gap : 10 px ;
// Hide the radio buttons
input [ type = " radio " ] {
display : none ;
}
// Style the label as a button to match the checkboxes
label . radio {
cursor : pointer ;
padding : 12 px ; // Match the padding with the other styled elements
border : 1 px solid $add-user-input-border-color ;
border-radius : 6 px ;
background-color : $add-user-input-background ;
font-size : 16 px ;
text-align : center ;
width : 100 % ; // Make the label full-width
transition : background-color 0 .3 s , color 0 .3 s , border-color 0 .3 s ;
user-select : none ;
// Change background when active or focused
& : hover ,
& : focus {
background-color : $user-form-radio-button-hover-color ;
border-color : $user-form-radio-button-hover-border-color ;
}
}
// Change styles when the radio button is checked
input [ type = " radio " ] : checked + label . radio {
background-color : $user-form-radio-button-active-color ;
color : $user-form-radio-button-active-text-color ;
border-color : $user-form-radio-button-active-border-color ;
}
}
// Style the range input to match the other form inputs
input [ type = " range " ] {
width : 100 % ; // Full width of the form group
height : 45 px ; // Match the height of the other input fields
-webkit-appearance : none ; // Remove default styling
appearance : none ;
border-radius : 6 px ; // Rounded corners, matching other inputs
background-color : $add-user-input-background ; // Same background color as other inputs
border : 1 px solid $add-user-input-border-color ; // Input field border color
cursor : pointer ; // Change cursor on hover
padding : 0 ; // Remove any default padding
box-sizing : border-box ; // Ensure padding is included in total width/height
// Style the filled portion of the track
& : : -webkit-slider-runnable-track {
width : 100 % ;
height : 100 % ;
border-radius : 6 px ; // Rounded corners
background : linear-gradient ( to right , $add-user-button-color 0 % , $add-user-button-color var ( -- value ) , $add-user-input-background var ( -- value )) ; // Gradient to indicate value
}
& : : -moz-range-track {
width : 100 % ;
height : 100 % ;
border-radius : 6 px ;
background : linear-gradient ( to right , $add-user-button-color 0 % , $add-user-button-color var ( -- value ) , $add-user-input-background var ( -- value )) ;
}
// Style the thumb
& : : -webkit-slider-thumb {
-webkit-appearance : none ; // Remove default appearance
appearance : none ;
width : 45 px ; // Thumb size
height : 45 px ;
border-radius : 50 % ; // Make the thumb round
background-color : $add-user-button-color ; // Thumb color
border : 2 px solid $add-user-input-border-color ; // Thumb border
cursor : pointer ;
//margin-top: -8px; // Center the thumb vertically
margin : 0 ;
padding : 0 ;
}
& : : -moz-range-thumb {
width : 24 px ;
height : 24 px ;
border-radius : 50 % ;
background-color : $add-user-button-color ;
border : 2 px solid $add-user-input-border-color ;
cursor : pointer ;
margin : 0 ;
padding : 0 ;
}
& : focus {
outline : none ; // Remove default focus outline
border-color : $add-user-input-focus-border-color ; // Change border color on focus
}
}
// Submit button styling
. submit-button {
flex : 1 1 100 % ; // Full width for the submit button
display : flex ; // Use flex to center the button
justify-content : center ; // Center the button
margin-top : 20 px ; // Space above the button
button {
width : 40 % ;
text-align : center ;
padding : 12 px ; // Padding for button
background-color : $add-user-button-color ; // Primary button color
color : $add-user-button-text-color ;
border : none ;
border-radius : 6 px ;
font-size : 18 px ;
font-weight : bold ;
cursor : pointer ;
transition : background-color 0 .3 s , transform 0 .3 s ;
box-shadow : 0 4 px 10 px $add-user-button-shadow ;
& : hover {
background-color : $add-user-button-hover-color ; // Button hover color
}
& : active {
transform : translateY ( 2 px ) ; // Subtle press effect
}
}
}
2024-10-24 21:31:16 +00:00
}
}
}