The basic idea of density functional theory is to map an interacting many-particle system on an effective non-interacting system in such a way that the ground-state densities of the two systems are identical. The non-interacting particles move in an effective local potential which is a functional of the density. The central task of density functional theory is to find good approximations for the density dependence of this local single-particle potential. An overview of recent advances in the construction of this potential (beyond the local-density approximation) will be given along with successful applications in quantum chemistry and solid state theory. We then turn to the extension of density functional theory to superconductors and first discuss the Hohenberg-Kohn-Sham-type existence theorems. In the superconducting analogue of the the normal-state Kohn-Sham formalism, a local single-particle potential is needed which now depends on two densities, the ordinary density n(r) and the anomalous density Δ(r, r′). As a first step towards the construction of such a potential, a gradient expansion technique for superconductors is presented and applied to calculate an approximation of the non-interacting kinetic energy functional Ts[n, Δ]. We also obtain a Thomas-Fermi-type variational equation for superconductors.