  Let $\mathbb{X}=[X_1\rightrightarrows X_0]$ be a Lie groupoid equipped with a
connection, given by a smooth distribution $\mathcal{H} \subset T X_1$
transversal to the fibers of the source map. Under the assumption that the
distribution $\mathcal{H}$is integrable, we define a version of de Rham
cohomology for the pair $(\mathbb{X}, \mathcal{H})$, and we study connections
on principal $G$-bundles over $(\mathbb{X}, \mathcal{H})$ in terms of the
associated Atiyah sequence of vector bundles. We also discuss associated
constructions for differentiable stacks. Finally, we develop the corresponding
Chern-Weil theory and describe characteristic classes of principal G-bundles
over a pair $(\mathbb{X}, \mathcal{H})$.
