// This does allow duplicates in the same hlive.ClassBool element.
This does allow duplicates in the same hlive.ClassBool element.
// This does allow duplicates in the same hlive . ClassBool element .
func addCSS(t *Tag, v ClassBool) {
	for class, enable := range v {
		if enable {
			if !t.cssExists[class] {
				t.cssExists[class] = true
				t.cssOrder = append(t.cssOrder, class)
			}
		} else {
			delete(t.cssExists, class)
		}
	}
	var newOrder []string
	for i := 0; i < len(t.cssOrder); i++ {
		if t.cssExists[t.cssOrder[i]] {
			newOrder = append(newOrder, t.cssOrder[i])
		}
	}
	t.cssOrder = newOrder
}
func addCSS ( t * Tag , v ClassBool ) { for class , enable := range v { if enable { if ! t . cssExists [ class ] { t . cssExists [ class ] = true t . cssOrder = append ( t . cssOrder , class ) } } else { delete ( t . cssExists , class ) } } var newOrder [ ] string for i := 0 ; i < len ( t . cssOrder ) ; i ++ { if t . cssExists [ t . cssOrder [ i ] ] { newOrder = append ( newOrder , t . cssOrder [ i ] ) } } t . cssOrder = newOrder }
This does allow duplicates in the same hlive.ClassBool element.
This does allow duplicates in the same hlive . ClassBool element .
// Update the map // Update the order // Loop over order and remove all that no longer exists