@@ -38,7 +38,7 @@ const toastModule = new function() {
38
38
// Create the container for the toasts
39
39
createContainer ( position ) {
40
40
const container = document . createElement ( 'div' ) ;
41
- container . className = `enable-toast enable-toast --${ position } ` ;
41
+ container . className = `enable-toast__container enable-toast__container --${ position } ` ;
42
42
return container ;
43
43
}
44
44
@@ -57,7 +57,7 @@ const toastModule = new function() {
57
57
toastElement . offsetHeight ; // Force reflow to ensure the element is rendered before adding the visible class
58
58
59
59
setTimeout ( ( ) => {
60
- toastElement . classList . add ( 'enable-toast --visible' ) ;
60
+ toastElement . classList . add ( 'enable-toast__item --visible' ) ;
61
61
} , 100 ) ; // Slight delay to ensure screen readers catch the change
62
62
63
63
// Update the toast rack with the new toast
@@ -66,7 +66,7 @@ const toastModule = new function() {
66
66
this . updateToggleRackButton ( ) ;
67
67
}
68
68
69
- // Create the individual toast element
69
+ // Create the individual toast element (Using enable-toast__item)
70
70
createToastElement ( toastData ) {
71
71
const { message, level, id } = toastData ;
72
72
const toast = document . createElement ( 'div' ) ;
@@ -98,7 +98,7 @@ const toastModule = new function() {
98
98
dismissToast ( toastData ) {
99
99
const toastElement = this . container . querySelector ( `[data-id="${ toastData . id } "]` ) ;
100
100
if ( toastElement ) {
101
- toastElement . classList . add ( 'enable-toast --exit' ) ;
101
+ toastElement . classList . add ( 'enable-toast__item --exit' ) ;
102
102
setTimeout ( ( ) => {
103
103
toastElement . remove ( ) ;
104
104
this . visibleQueue = this . visibleQueue . filter ( t => t . id !== toastData . id ) ;
@@ -123,9 +123,9 @@ const toastModule = new function() {
123
123
this . visibleQueue . forEach ( ( toast , index ) => {
124
124
const toastElement = this . container . querySelector ( `[data-id="${ toast . id } "]` ) ;
125
125
if ( index < this . maxVisible ) {
126
- toastElement . classList . add ( 'enable-toast --visible' ) ;
126
+ toastElement . classList . add ( 'enable-toast__item --visible' ) ;
127
127
} else {
128
- toastElement . classList . remove ( 'enable-toast --visible' ) ;
128
+ toastElement . classList . remove ( 'enable-toast__item --visible' ) ;
129
129
}
130
130
} ) ;
131
131
@@ -146,7 +146,7 @@ const toastModule = new function() {
146
146
this . toastQueue . forEach ( toastData => {
147
147
const { message, level, id } = toastData ;
148
148
const toastElement = document . createElement ( 'div' ) ;
149
- toastElement . className = 'enable-toast__item enable-toast --visible' ;
149
+ toastElement . className = 'enable-toast__item enable-toast__item --visible' ;
150
150
toastElement . style . backgroundColor = this . levels [ level ] ?. color || '#333' ;
151
151
toastElement . setAttribute ( 'data-id' , id ) ;
152
152
0 commit comments