Skip to content
  • Home
  • About
  • No Access
  • Privacy Policy
Bits of .NET
Bits of .NET
  • Asp.Net Core
  • C#
  • SQL
  • JavaScript
  • CSS
  • About
  • ErcanOPAK.com
  • No Access
  • Privacy Policy

Bits of .NET

Daily micro-tips for C#, SQL, performance, and scalable backend engineering.

  • Asp.Net Core
  • C#
  • SQL
  • JavaScript
  • CSS
  • About
  • ErcanOPAK.com
  • No Access
  • Privacy Policy

Tag: Theming

CSS

CSS: Master CSS Variables for Theme Management

- 17.08.26 - ErcanOPAK comment on CSS: Master CSS Variables for Theme Management

🎨 CSS Variables = Theme Management Hard-coded colors are a maintenance nightmare. CSS Variables enable consistent theming and easy updates. 📝 CSS Variables Setup :root { /* Colors */ –color-primary: #3498db; –color-secondary: #2ecc71; –color-accent: #e74c3c; –color-background: #ffffff; –color-text: #2c3e50; –color-text-secondary: #7f8c8d; /* Typography */ –font-family: ‘Inter’, -apple-system, sans-serif; –font-size-base: 16px; –font-size-large: 1.25rem; –font-size-small: 0.875rem; /* […]

Read More
CSS

CSS: Master CSS Variables for Theme Management

- 25.07.26 - ErcanOPAK comment on CSS: Master CSS Variables for Theme Management

🎨 CSS Variables = Theme Management Hard-coded colors are a maintenance nightmare. CSS Variables enable consistent theming and easy updates. 📝 CSS Variables Setup :root { /* Colors */ –color-primary: #3498db; –color-secondary: #2ecc71; –color-accent: #e74c3c; –color-background: #ffffff; –color-text: #2c3e50; –color-text-secondary: #7f8c8d; /* Typography */ –font-family: ‘Inter’, -apple-system, sans-serif; –font-size-base: 16px; –font-size-large: 1.25rem; –font-size-small: 0.875rem; /* […]

Read More
CSS

CSS: Use Custom Properties for Maintainable Styles

- 09.07.26 - ErcanOPAK comment on CSS: Use Custom Properties for Maintainable Styles

🎨 CSS Variables = Maintainable Styles Hardcoded colors are bad. CSS variables centralize values. Change once, update everywhere. 📝 CSS Variables Basics /* Define variables */ :root { –primary-color: #3498db; –secondary-color: #2ecc71; –text-color: #333; –spacing: 16px; –border-radius: 4px; –font-size: 16px; } /* Use variables */ .button { background: var(–primary-color); color: white; padding: var(–spacing); border-radius: var(–border-radius); […]

Read More
CSS

CSS: Use CSS Variables for Maintainable Styles

- 07.07.26 - ErcanOPAK comment on CSS: Use CSS Variables for Maintainable Styles

🎨 CSS Variables = Maintainable Styles Hardcoded colors are bad. CSS variables centralize values. Change once, update everywhere. Theming made easy. 📝 Variable Basics /* Define variables */ :root { –primary-color: #3498db; –secondary-color: #2ecc71; –text-color: #333; –spacing-unit: 16px; –border-radius: 4px; } /* Use variables */ .button { background-color: var(–primary-color); color: white; padding: var(–spacing-unit); border-radius: var(–border-radius); […]

Read More
CSS

CSS: Use CSS Variables for Consistent Theming

- 13.06.26 - ErcanOPAK comment on CSS: Use CSS Variables for Consistent Theming

🎨 Change Entire Site Theme with One Variable Update Sass variables compile once. CSS variables update at runtime. Dark mode, dynamic theming, component libraries. 📝 Defining Variables :root { –primary-color: #3498db; –secondary-color: #2ecc71; –spacing-unit: 8px; –border-radius: 4px; –font-size-base: 16px; } .button { background-color: var(–primary-color); padding: var(–spacing-unit) calc(var(–spacing-unit) * 2); border-radius: var(–border-radius); } 🎯 Dynamic Dark […]

Read More
CSS

CSS: Use Container Style Queries to Respond to Parent Styling

- 06.06.26 - ErcanOPAK comment on CSS: Use Container Style Queries to Respond to Parent Styling

🎨 Not Just Size, But Parent’s CSS Properties Container queries check parent size. Style queries check parent CSS values. Dark mode per component? Yes. 📝 Basic Style Query .card { container-name: card; container-type: inline-size; } @container card style(–theme: dark) { .card { background: #1a1a2e; color: #e0e0e0; border-color: #333; } } @container card style(–theme: light) { […]

Read More
CSS

CSS: Use New Color Functions for Dynamic Theming

- 31.05.26 - ErcanOPAK comment on CSS: Use New Color Functions for Dynamic Theming

🎨 Color Manipulation Without Preprocessors Sass had lighten(), darken(), mix(). CSS now has color-mix(), relative colors, and OKLCH. Native color functions! 🎨 color-mix() /* Mix two colors */ .hover-effect { background-color: color-mix(in srgb, blue 30%, red); } .brand-gradient { background: color-mix(in oklch, var(–primary) 50%, white); } /* Mix with transparency */ .transparent-blue { background: color-mix(in […]

Read More
CSS

CSS: Use CSS Variables for Theming and Dynamic Styling

- 27.05.26 - ErcanOPAK comment on CSS: Use CSS Variables for Theming and Dynamic Styling

🎨 One Variable Change, Whole Site Updates Sass variables compile once. CSS variables update at runtime. Dark mode, dynamic theming, component libraries — finally possible. 📦 Defining and Using Variables /* Define on :root (global) */ :root { –primary-color: #3498db; –secondary-color: #2ecc71; –spacing-unit: 8px; –border-radius: 4px; –font-size-base: 16px; } /* Use variables */ .button { […]

Read More
CSS

CSS: Use Custom Properties (CSS Variables) for Dynamic Theming

- 15.02.26 - ErcanOPAK comment on CSS: Use Custom Properties (CSS Variables) for Dynamic Theming

Changing colors throughout CSS is tedious. CSS variables centralize values for easy updates. Define Variables: :root { –primary-color: #3498db; –secondary-color: #2ecc71; –font-size-base: 16px; –spacing-unit: 8px; } Use Variables: button { background: var(–primary-color); font-size: var(–font-size-base); padding: calc(var(–spacing-unit) * 2); } Dynamic Theming: /* Light theme (default) */ :root { –bg-color: white; –text-color: black; } /* Dark […]

Read More
November 2026
M T W T F S S
 1
2345678
9101112131415
16171819202122
23242526272829
30  
« Oct    

Most Viewed Posts

  • How to make theater mode the default for Youtube (1,055)
  • Get the User Name and Domain Name from an Email Address in SQL (981)
  • How to add default value for Entity Framework migrations for DateTime and Bool (977)
  • Get the First and Last Word from a String or Sentence in SQL (858)
  • How to select distinct rows in a datatable in C# (854)
  • How to enable, disable and check if Service Broker is enabled on a database in SQL Server (653)
  • Add Constraint to SQL Table to ensure email contains @ (609)
  • Average of all values in a column that are not zero in SQL (570)
  • How to use Map Mode for Vertical Scroll Mode in Visual Studio (547)
  • Find numbers with more than two decimal places in SQL (475)

Recent Posts

  • C#: Fix a ConditionalWeakTable Entry Vanishing Too Soon
  • Docker: Fix a Stale COPY Layer After Editing .dockerignore
  • Photoshop: Fix a Pattern Overlay Scaling Wrong on a High-DPI File
  • SQL Server: Fix a Computed Column Index Skipped by Implicit Cast
  • HTML5: Fix a required Input Inside a Hidden Tab Blocking Submit
  • SQL Server: Fix ROW_NUMBER Ties Reordering Between Identical Runs
  • C#: Fix an Enum HasFlag Returning True for the Zero Value
  • WordPress: Fix Featured Images Vanishing After a CDN Migration
  • Photoshop: Fix Content-Aware Fill Smearing a Repeating Pattern
  • Asp.Net Core: Fix Antiforgery Tokens Rejected Behind a Reverse Proxy

Most Viewed Posts

  • How to make theater mode the default for Youtube (1,055)
  • Get the User Name and Domain Name from an Email Address in SQL (981)
  • How to add default value for Entity Framework migrations for DateTime and Bool (977)
  • Get the First and Last Word from a String or Sentence in SQL (858)
  • How to select distinct rows in a datatable in C# (854)

Recent Posts

  • C#: Fix a ConditionalWeakTable Entry Vanishing Too Soon
  • Docker: Fix a Stale COPY Layer After Editing .dockerignore
  • Photoshop: Fix a Pattern Overlay Scaling Wrong on a High-DPI File
  • SQL Server: Fix a Computed Column Index Skipped by Implicit Cast
  • HTML5: Fix a required Input Inside a Hidden Tab Blocking Submit

Social

  • ErcanOPAK.com
  • GoodReads
  • LetterBoxD
  • Linkedin
  • The Blog
  • Twitter
© 2026 Bits of .NET | Built with Xblog Plus free WordPress theme by wpthemespace.com