  We introduce a new method for computing bounds on the independence number and
fractional chromatic number of classes of graphs with local constraints, and
apply this method in various scenarios. We establish a formula that generates a
general upper bound for the fractional chromatic number of triangle-free graphs
of maximum degree~$\Delta \ge 3$. This upper bound matches that deduced from
the fractional version of Reed's bound for small values of~$\Delta$, and
improves it when~$\Delta\ge 17$, transitioning smoothly to the best possible
asymptotic regime, barring a breakthrough in Ramsey theory. Focusing on smaller
values of~$\Delta$, we also demonstrate that every graph of girth at least~$7$
and maximum degree~$\Delta$ has fractional chromatic number at most~$1+ \min_{k
\in \mathbb{N}} \frac{2\Delta + 2^{k-3}}{k}$. In particular, the fractional
chromatic number of a graph of girth~$7$ and maximum degree~$\Delta$ is at
most~$\frac{2\Delta+9}{5}$ when~$\Delta \in [3,8]$, at
most~$\frac{\Delta+7}{3}$ when~$\Delta \in [8,20]$, at
most~$\frac{2\Delta+23}{7}$ when~$\Delta \in [20,48]$, and at
most~$\frac{\Delta}{4}+5$ when~$\Delta \in [48,112]$. In addition, we also
obtain new lower bounds on the independence ratio of graphs of maximum
degree~$\Delta \in \{3,4,5\}$ and girth~$g\in \{6,\dotsc,12\}$, notably~$1/3$
when~$(\Delta,g)=(4,10)$ and~$2/7$ when~$(\Delta,g)=(5,8)$.
