We designed a trigonal symmetric imine-linked covalent organic framework (COF), TFPC-DAB, with control over the angularity of the building units, where a bent C2-symmetric diamine, such as 1,3-diaminobenzene (1,3-DAB or DAB), with an exo-angle of 120° was used instead of those with an exo-angle of 180°, in combination with a C3-symmetric trialdehyde, such as tri(4-formylphenoxy)cyanurate (TFPC). Its synthesis was accomplished by reacting the building units in a mixture of mesitylene/dioxane/6 M acetic acid under solvothermal conditions. The phase purity, thermal stability, and porosity of TFPC-DAB were established by various analytical techniques. Utilizing the Density Functional Tight Binding (DFTB+) simulation and Pawley refinement, the best fit of the small angle x-ray pattern was found to have an AA stacking of TFPC-DAB in the trigonal space group P3 with low refinement parameters. Such smart materials are in huge demand to detect hazardous corrosive chemicals, such as HCl and NH3. The dual features of electron deficient π-acidic triazine moiety and heteroatoms (N/O) from TFPC and electron rich phenyl units from DAB embodied in the framework enhance its luminescent property and thereby make it suitable for solvent-based HCl and NH3 sensing. The detection limits for HCl and NH3 in methanol were found to be 14 and 82 ppb, respectively. The effect of solvent polarity on the sensing studies was observed with much lower detection limits in dioxane: 2.5 and 11 ppb for HCl and NH3, respectively. A detailed theoretical calculation using density functional theory and configurational bias Monte Carlo modules was conducted for understanding interactions between the COF and HCl or NH3 analytes.