I wish to add the class `rounded-t-lg shadow`on the first iteration inside the if statement, and `rounded-b-lg shadow` on the last iteration. I have the following code:

```
{% for note in notes %}
    {% if note.is_sticky %}
        <div class="flex items-center">
            <div class="{% if forloop.first %} rounded-t-lg shadow {% elif forloop.last %} rounded-b-lg shadow {% endif %}">
                <!-- code -->     
                </div>     
            </div>
        </div>
    {% endif %}
{% endfor %}

```

The problem that I'm running into is that forloop.last applies to the last iteration in general, and not the last iteration in the condition. So if I have three objects, where two is sticky, and the last one is not, the class will be applied to the one that is not, since its the last in "line".

How can I apply a class to the last iteration within the is\_sticky condition, regardless of the objects that do not meet the condition?