forms.css 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. /* Style global du formulaire */
  2. form {
  3. max-width: 850px;
  4. margin: 50px auto;
  5. padding: 20px;
  6. background-color: #f9f9f9;
  7. border-radius: 8px;
  8. box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  9. font-family: 'Arial', sans-serif;
  10. }
  11. /* Style pour les labels */
  12. form label {
  13. display: block;
  14. font-weight: bold;
  15. margin-bottom: 8px;
  16. color: #333;
  17. }
  18. /* Style pour les champs de saisie */
  19. form input[type="text"],
  20. form input[type="email"],
  21. form input[type="password"],
  22. form textarea,
  23. form select {
  24. width: 100%;
  25. padding: 12px;
  26. margin-bottom: 20px;
  27. border: 1px solid #ccc;
  28. border-radius: 4px;
  29. background-color: #fff;
  30. font-size: 16px;
  31. box-sizing: border-box;
  32. transition: border-color 0.3s ease-in-out;
  33. }
  34. /* Style pour les erreurs (si Symfony utilise des classes pour les erreurs) */
  35. form label + ul li {
  36. color: #e74c3c;
  37. font-size: 0.875rem;
  38. }
  39. /* Help de l'input */
  40. form .help-text {
  41. color: gray;
  42. margin-top: 0;
  43. margin-bottom: 30px;
  44. margin-left: 20px;
  45. }
  46. form #bouton-slug {
  47. margin: 0;
  48. padding: 5px;
  49. display: inline-block;
  50. color: gray;
  51. border: 1px solid black;
  52. text-decoration: none;
  53. border-radius: 5px;
  54. }
  55. form .div-bouton-slug {
  56. display: flex;
  57. justify-content: right;
  58. }
  59. /* Focus pour améliorer l'expérience utilisateur */
  60. form input[type="text"]:focus,
  61. form input[type="email"]:focus,
  62. form input[type="password"]:focus,
  63. form textarea:focus,
  64. form select:focus {
  65. border-color: #007bff;
  66. outline: none;
  67. box-shadow: 0 0 8px rgba(0, 123, 255, 0.25);
  68. }
  69. /* Style pour les textarea */
  70. form textarea {
  71. min-height: 150px;
  72. resize: vertical; /* Permet de redimensionner verticalement seulement */
  73. }
  74. /* Style pour les boutons */
  75. form button[type="submit"],
  76. form input[type="submit"] {
  77. display: inline-block;
  78. width: 100%;
  79. padding: 12px;
  80. font-size: 16px;
  81. font-weight: bold;
  82. color: #fff;
  83. background-color: #007bff;
  84. border: none;
  85. border-radius: 4px;
  86. cursor: pointer;
  87. transition: background-color 0.3s ease-in-out;
  88. }
  89. form button[type="submit"]:hover,
  90. form input[type="submit"]:hover {
  91. background-color: #0056b3;
  92. }
  93. /* Style pour les cases à cocher et les boutons radio */
  94. form input[type="checkbox"],
  95. form input[type="radio"] {
  96. margin-right: 10px;
  97. }
  98. /* Wrapper pour les cases à cocher et radio */
  99. .form-check {
  100. margin-bottom: 20px;
  101. }
  102. .form-check-label {
  103. display: inline-block;
  104. color: #333;
  105. }
  106. /* Style pour les messages d'erreur (champ obligatoire, etc.) */
  107. .invalid-feedback {
  108. color: #e74c3c;
  109. margin-top: -15px;
  110. margin-bottom: 10px;
  111. font-size: 0.875rem;
  112. }
  113. /* Message de succès */
  114. form .success-message {
  115. color: #28a745;
  116. font-size: 1rem;
  117. margin-bottom: 20px;
  118. display: none;
  119. }
  120. /* Style pour les selects */
  121. form select {
  122. appearance: none;
  123. background: url('data:image/svg+xml;charset=US-ASCII,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 4 5"><path fill="none" stroke="%23333" stroke-width=".5" d="M2 0L0 2h4z"/></svg>') no-repeat right 10px center;
  124. background-size: 12px;
  125. }