I wonder how to attach a library to a specific content type. .e.g News. I found the following code from a post and applied the "hook" to the "node" but no idea how to filter by content type. Any idea?
function fluffiness_preprocess_node(&$variables) {
$variables['#attached']['library'][] = 'fluffiness/cuddly-slider';
}