Kung gusto mong gumamit ng mas modernong CSS techniques ngayong 2025, eto yung mga dapat mong subukan. Mas magiging maayos, mabilis, at SEO-friendly ang website mo gamit ang mga ito.
1. Variable Fonts
Mas flexible ang typography gamit ang variable fonts. Mas magaan din sa load time kasi hindi mo kailangang gumamit ng maraming font files.
@font-face {
font-family: 'Inter';
src: url('Inter-VariableFont.ttf') format('truetype');
font-weight: 100 900;
}
h1 {
font-family: 'Inter', sans-serif;
font-weight: 700; /* Pwede kang mag-adjust ng values mula 100 to 900 */
}
2. CSS Houdini
Nagbibigay ito ng mas maraming custom styling options sa CSS gamit ang JavaScript.
@property --magicColor {
syntax: '<color>';
inherits: false;
initial-value: red;
}
button {
--magicColor: blue;
background-color: var(--magicColor);
transition: background-color 0.3s ease-in-out;
}
button:hover {
--magicColor: green;
}
3. Subgrid Layout
Mas madali kang makakagawa ng complex layouts dahil pwede mong ipamana ang grid lines ng isang parent grid sa kanyang mga anak.
.container {
display: grid;
grid-template-columns: 1fr 2fr;
}
.subgrid {
display: grid;
grid-template-columns: subgrid;
}
4. CSS Scroll Snap
Kapag may carousel o gallery, pwede mong gawing smoother ang pag-scroll gamit ito.
.container {
scroll-snap-type: x mandatory;
overflow-x: auto;
display: flex;
}
.item {
scroll-snap-align: center;
width: 300px;
height: 200px;
}
5. Clipping at Masking
Gamit ito, pwede kang gumawa ng mga custom shapes sa CSS.
.image {
clip-path: circle(50%);
}
6. CSS Blend Modes
Pwedeng pagsamahin ang background at images gamit ang blend modes.
.image {
background: url('image.jpg');
mix-blend-mode: multiply;
}
7. Conical Gradients
Mas maraming gradient options ngayon bukod sa linear at radial.
.gradient {
background: conic-gradient(red, yellow, green);
}
8. CSS Variables (Custom Properties)
Mas madali ang maintenance ng styles gamit ang variables.
:root {
--primary-color: blue;
}
.button {
background-color: var(--primary-color);
}
9. CSS Nesting
Mas malinis at organisado ang CSS gamit ang nesting.
.card {
background: #fff;
& h1 {
font-size: 20px;
}
& p {
color: gray;
}
}
10. Container Queries
Mas flexible ang responsive design gamit ito.
.container {
container-type: inline-size;
}
@container (min-width: 600px) {
.content {
font-size: 20px;
}
}
Kung gusto mong maging updated sa web development, magandang subukan ang mga bagong CSS features na ito. Hindi lang mas maganda ang design, mas mabilis pa ang website mo.
Facebook Comments